Perl-Sensitive Sunglasses | |
PerlMonks |
(bbfu) (soft-refs) Re(2): Spliting letters in a stringby bbfu (Curate) |
on May 08, 2001 at 02:15 UTC ( [id://78684]=note: print w/replies, xml ) | Need Help?? |
I really do believe that you already realize that this is dangerous and were just offering it as a "well, if that's really what you want to do then this is how you do it..." kind of thing. Continuing in that spirit, some suggestions... You should make sure that you don't conflict with use strict by doing a (block-scoped) no strict 'refs';. You might also want to local $_. I would also suggest avoiding using map in void context because it spends a lot of energy building a return list and actually tends to be slower than an equivalent for loop in many cases; and, IMHO, it doesn't really improve the legibility any.
Of course, these are all just suggestions. You're code was perfectly useable to begin with. :-) Update: Improved the wording a little. Removed unnecessary braces in deref in code. Changed no meaning. :-) bbfu
In Section
Seekers of Perl Wisdom
|
|