in reply to how to dynamically declare a varialble?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: how to dynamically declare a varialble?
by Jenda (Abbot) on May 22, 2004 at 19:16 UTC | |
by Anonymous Monk on May 23, 2004 at 06:58 UTC | |
by dragonchild (Archbishop) on May 24, 2004 at 13:05 UTC | |
by Jenda (Abbot) on May 24, 2004 at 16:21 UTC | |
by dragonchild (Archbishop) on May 24, 2004 at 16:27 UTC |