On Wed, 30 May 2007 12:14:52 -0400, "Chas Owens" <[EMAIL PROTECTED]>
wrote:

<snip/>
...
> http://www.perl.com/pub/a/2004/06/25/profiling.html
> http://search.cpan.org/~nwclark/perl-5.8.8/utils/dprofpp.PL

<snip/>

> The following code seems to speed up the parsing by two orders of
> magnitude (2.214 seconds 

<snip/>

> found 38 fields in 10 records
> found 39 fields in 9 records
> found 40 fields in 12 records
> found

<snip/>

> ===code to parse test file===
> #!/usr/bin/perl
> 
> use strict;
> use warnings;
> 
> my $record = "";
> my $quotes = 0;
> my @records;
> while (defined (my $line = <>)) {
>         next if $record eq "" and $line =~ /^\s*$/;
> 
>         $record .= $line;
> 
>         #count the number of quotes
>      

<snip/>

Did not I thank you for this ? Shame on me.. Thanks all the same.. your
code actually helped me several folds.. 
 * It also taught me to think of optimisation more seriously. 
 * your code did not time out my cgi :-P

Thanks a tonne!

-- 
Cheers,
Laxminarayan G Kamath A
e-mail: [EMAIL PROTECTED]
Work URL: http://deeproot.in

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to