![]() |
|
Problems? Is your data what you think it is? | |
PerlMonks |
Re: How to eval an array element in regex's substitutionby aquarium (Curate) |
on Oct 27, 2010 at 04:23 UTC ( #867605=note: print w/replies, xml ) | Need Help?? |
In the scope/context provided, it doesn't make sense to use regex to achieve "Hello zy". If it's always going to be "Hello " followed by index 2 and index 1 of @a array, then just make it:
my $s = 'Hello ' . $a[2] . $a[1];
which can be easily parametarised in that format. Or even use splice. why the regex?
the hardest line to type correctly is: stty erase ^H
In Section
Seekers of Perl Wisdom
|
|