in reply to How to eval an array element in regex's substitution
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to eval an array element in regex's substitution
by aquarium (Curate) on Oct 27, 2010 at 05:40 UTC | |
by Anonymous Monk on Oct 27, 2010 at 06:23 UTC | |
by aquarium (Curate) on Oct 27, 2010 at 21:52 UTC |
In Section
Seekers of Perl Wisdom