in reply to Re: Re: Re: How to remove the $1 hard coding
in thread How to remove the $1 hard coding
Probably you meant this.
You need () to capture something into the array. You need the switch /g if you want to put every match into an array, not just the first match (hence for the index [$i] to work).push @a, ('a b c'=~/(\w) /g)[1]; print "@a";
In Section
Seekers of Perl Wisdom