Perl: the Markov chain saw | |
PerlMonks |
Re^3: Pls help optomize - ksh version 60% faster!by davidrw (Prior) |
on Sep 29, 2005 at 01:29 UTC ( [id://495958]=note: print w/replies, xml ) | Need Help?? |
Yes, you're right -- the hashing would be more efficient, though @rptType is used later in the code, so need to keep %seen in addition, or the later use might be able to be keys %seen instead of @rptType (unless order matters) .. or could just always push onto @rptType and throw out dups later (see tihs idiom, but destroys order) As for matching with /$rptType/, y, that seems suspicious .. i too now suspect that it should be eq instead, but can't say for sure.. also, looking at this again, the first of my two lines is unnecessary -- it seemed at first that the author wanted a double push onto @rptType, but that's not the case.. I've ammended my post above.. anyways, ++ and thanks for double-checking my post!!
In Section
Seekers of Perl Wisdom
|
|