What version of perl and what operating system? There can be a very wide range of difference between versions and operating systems and the slowness you experience may not be typical of all perl users.
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
perlmonks.com
devshed.com
perlguru.com
stackoverflow.com (not a "forum")
unix.com has no dedicated perl forum but there is a "shell programming and scripting" forum and it is very busy but 99% of the questions are other than perl.
------------------------------------------
- Kevin, perl...
This is definetly wrong:
$#{@{$listref}}
that's a double-layering of dereferencing and should have been:
$#{$listref}
I don't know why it would work in 5.8 with "strict" turned on.
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
Its not hard to do. I assume you didn't know the difference between "compile" and "run" times and the difference between "use" and "require". Now that you know you can load modules conditionally all you want.
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
Keep adding hash keys and counting what you need. What have you tried?
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
there is a pragma called "if" that allows you to conditionally load modules but I am not familiar with its usage. Might be new for perl 5.10
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
use a hash where the dates are the hash keys and the value is the count.
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
Your code should be printing the first line of the file, not the last, either before or after appending new data to the file.
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
free perl IDE for Windows: www.perl-express.com
don't bother with PWS, download and install apache: www.apache.org
You can google for "apache setup tutorial" to get your CGI scripts running
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
Assuming the perl script is in the cgi-bin, and the style-sheet is in the web root ( if it isn't you may have to move it there), you should make the path to the style sheet relative to the cgi-bin using ../ in the URI:
<link rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\">\n
the...
The first argument to split() is a regexp, not a string. Even using single-quotes does not make it a string, so you have to escape special characters like ^.
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
The Perl.pm file should go in a directory name Syntax/Highlight (Syntax::Highlight) relative to the directory where tekify.cgi is stored or you could add it to @INC with the lib pragma. Its pure perl so doesn't have to be installed, you can just upload the source code. tekify.cgi has the color...
Sorry, I renamed it tekify.txt so you can get the source code now. Rename it to .cgi or .pl if your server requires one of those extensions to execute a perl script.
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
The perl to TGML convertor is an existing CPAN module that I modified to add TGML code and the links to perldoc and some other modifications I no longer remember.
http://search.cpan.org/~johnsca/Syntax-Highlight-Perl-1.0/lib/Syntax/Highlight/Perl.pm
The two scripts can be downloaded from...
hehehe..... thats funny. You tell printf to add spaces on the right if necessary to pad a string to ten places, but then you don't want the spaces! Try not using printf and just use print.
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
this line:
if (m#^(\d{1,2}/\d{1,2}/\d\d{2,4})#) {
better written as:
if (m#^(\d{1,2}/\d{1,2}/\d{2,4})#) {
if the date is always in MM/DD/YYYY you could just use that pattern exclusively:
if (m#^(\d\d/\d\d/\d\d\d\d#) {
------------------------------------------
- Kevin, perl coder...
Going by the very slim example of data, this is a barebones of a script you can expand on:
use strict;
use warnings;
my %ReportHash;
my $key;
open(my $REPOPT ,'path/to/report/file') or die "$!";
while( <$REPORT>) {
chomp;
next if (/^\s*$/);#skip blank lines
if...
900,000,000
In US(A) thats 900 million. Still a lot of whatever.
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
mikrom,
you're welcome to use this Perl to TGML converter if you want to:
http://www.e-pixs.com/highlight/
------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.