Perl: the Markov chain saw | |
PerlMonks |
Re: Scalar joining, concatenation, involving varying textby Animator (Hermit) |
on Jun 27, 2005 at 21:38 UTC ( [id://470393]=note: print w/replies, xml ) | Need Help?? |
As I see it you have two options: one that requires 'no strict qw/refs/' and one that works fine under use strict. Both of these use a simple foreach loop. (both of these examples are similar to the one ikegami posted in the read-more tags.) Or do you really want a solution that uses map? It is also my opinion that using eval for this is simply a bad idea... why use a complex, slow and dangerous (if used incorrectly) function for something soo simple? First one: uses soft-reference, and does not work with lexical variables
Second one: (You could write this one using one long list aswell, but then you would need to use a C-style for loop.)
In Section
Seekers of Perl Wisdom
|
|