Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Thanks for your very insightful answer ! PerlMonks is such a great place because people like you take the time to research into questions and give the great replies as this :-)
A few points:
My machine is Win2k on P4 1800 GHz and 256 MB of memory. Also, could you please elaborate on the use of the following line: $/ = \(100*1024*1024) I only used $/ as in "undef $/" to read a file wholly, or to set a record separator. What does your line do ? ----------- Update ------------
I think I figured out the performance problem. My PC usually runs at 190 MB memory usage, which means that the 100MB slurped threw it into the "virtual realm", which naturally downgrades performance.
And then just compare to the wanted value. The whole process (which now combines reading & testing) takes 28 seconds. By the way, I was wrong about other thing. You first method (with substr) works correctly - it doesn't find the string. The second method (with index) seems to do find a string, or at least it thinks so, which is probably wrong (look at your test output, it's obvious there too) In reply to Re: Re: is perl the best tool for this job?(emphatically Yes!)
by spurperl
|
|