Re: in what array do all the $1,$2,... live?



jidanni@xxxxxxxxxxx wrote:
What is the name of the array where all the $1,$2,... live?
Or do I really need to gather them up manually:
@all_the_matches=($1,$2,$3,$4,$5,...);
man perlvar doesn't mention it.

Well, you can easily put them all in whatever array you want:

use strict;
use warnings;
my $string='abc';
my @array=$string=~/(.)(.)(.)/;
print join ':',@array;

--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
.



Relevant Pages