From: Robin on
How can I place everything the =~ operator has matched into an arrayy?

Thank you in advance.

peace,


--
Robin

--
robin1(a)cnsp.com


From: Ben Morrow on

Quoth "Robin" <robin1(a)cnsp.com>:
> How can I place everything the =~ operator has matched into an arrayy?

You will need to be more specific about what you want. You might want

my @array = $string =~ /pattern/g;

but it's hard to be sure.

Ben

From: Keith Bradnam on
On Nov 3, 12:53 pm, "Robin" <rob...(a)cnsp.com> wrote:
> How can I place everything the =~ operator has matched into an arrayy?
>
> Thank you in advance.

Do you mean that you want everything that is matched to become the
first element of an array? If not, maybe it would help to illustrate
the type of data that you are working with?

K.
From: Brandon Metcalf on
On 2009-11-03, Robin <robin1(a)cnsp.com> wrote:
> How can I place everything the =~ operator has matched into an arrayy?


$ cat jj
#!/usr/bin/perl -l

use strict;
use warnings;

my $string = '123aaa';

my ($p1,$p2) = ($string =~ /(\d+)(\w+)/);

print $p1;
print $p2;
$ ./jj
123
aaa

--
Brandon