|
|
| Do you know where your variables are? | |
| PerlMonks |
Re: Replacing values in an arrayby johngg (Abbot) |
| on Jan 27, 2013 at 00:05 UTC ( #1015552=note: print w/ replies, xml ) | Need Help?? |
|
A slight variation on toolic's and eyepopslikeamosquito's solutions in that I use a closure to generate the odd numbers (it returns the next odd number every time it is called) and I wrap the logic for finding duplicates in a do block to avoid leaving the %seen hash lying around after it is no longer needed.
I hope this is of interest. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||