Update: Jenda pointed me to the actual question.
Sampath - you want to assign the matches to an array. Something along the lines of:
my $string = "aabbccdd"; if (my @matches = $string =~ /(aa)..(cc)../) { print "@matches\n"; print "$matches[0] ... $matches[1]\n"; }
The difference is that $1 will be in $matches[0], and so forth.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
In reply to Re: how to dynamically declare a varialble?
by dragonchild
in thread how to dynamically declare a varialble?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |