Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: regex to find vowels in anyorderby Not_a_Number (Prior) |
on Dec 19, 2011 at 20:20 UTC ( [id://944294]=note: print w/replies, xml ) | Need Help?? |
I'm trying to find a regex that will... You don't need no steenkin' regex:
Pretty fast, too, you'll find... Update: Hmm, if you take out the line no warnings 'uninitialized'; (and therefore remove use warnings or whatever from the start of the code), it seems to run nearly 20% faster still...Comments welcome. Update 2: Oops, just realised that my code doesn't work! Change the contents of the inner while loop to: $array[ $hash{ $char } ] = 1 if defined $hash{ $char };Which is what I had originally, before playing with no warnings 'uninitialized';. And then I didn't test properly. Mea culpa.
In Section
Seekers of Perl Wisdom
|
|