chomp(my $input = <STDIN>); my @simMatches = qw(abcd wxyz); my $pat = qr/(.)..(.)/; @simMatches = map{ @_ = /$pat/; s/$pat/$_[$input-1]/; $_ }@simMatches; print join $", @simMatches; __END__ $input == 1; a w $input == 2; d z
In reply to Re: Is there an array for $1,$2,$3... or some alternative ?
by Anonymous Monk
in thread Is there an array for $1,$2,$3... or some alternative ?
by palkia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |