Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: The nth occurrence of a characterby mickeyn (Priest) |
on Feb 08, 2006 at 15:03 UTC ( [id://528813]=note: print w/replies, xml ) | Need Help?? |
allow me to suggest another way that may serve you if you want to access different characters at different occurances many times:
now, for each character you have a hash entry with all its positions in the string (array).
You wannted efficient function, and this way allows you to get you data in one hash+array access which IMHO is efficient.
Enjoy,
In Section
Seekers of Perl Wisdom
|
|