Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Why is my program so slow even though I've used hashes?

by ikegami (Patriarch)
on May 28, 2009 at 17:31 UTC ( [id://766711]=note: print w/replies, xml ) Need Help??


in reply to Why is my program so slow even though I've used hashes?

Bug: The following do anything (useful):

$res =~/\S/g; $domchain =~/\S/g; $pdbchain =~/\S/g;

You want:

$res =~ s/\s//g; $domchain =~ s/\s//g; $pdbchain =~ s/\s//g;

Also, all over you have "$var" which needlessly makes a copy of $var. Drop the quotes. You want just $var. For example,

if("$domchain" eq "$pdbchain")
should be
if($domchain eq $pdbchain)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-03-28 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found