Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Speeding up stalled script

by Athanasius (Archbishop)
on Feb 03, 2015 at 03:29 UTC ( [id://1115334]=note: print w/replies, xml ) Need Help??


in reply to Speeding up stalled script

Hello onlyIDleft,

Not an answer, just a couple of observations. This code (comments removed):

while(<IN1>) { chomp; if ($_=~ m/\>/) { } elsif ($_!~ m/\>/) { push @lengths, length($_); } }

can be replaced with the equivalent:

while (<IN1>) { chomp; push @lengths, length $_ unless />/; }

Update: No need to escape > in a regex.

And similarly, this code (comments removed):

while(<IN2>) { chomp; if ($_=~ m/\>/) { push @source, $_; } elsif ($_!~ m/\>/) { push @source, $_; } }

is equivalent to:

chomp, push @source, $_ while <IN2>;

:-)

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1115334]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-18 06:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found