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 reply to Re: Re: Re: Re: How to remove the $1 hard coding
by chunlou
in thread How to remove the $1 hard coding
by abhishes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |