Thanks Jeff
However
@first25 = grep{$_->[1] =~ /^MA\d/} @all;
results in
"Modification of a read only value attempted"

----- Original Message -----
From: "Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]>
To: "Clinton" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, October 23, 2001 11:40 AM
Subject: Re: Syntax for grep using regex


> On Oct 23, Clinton said:
>
> >@first25 = grep{$_->[1] eq (/^MA\d+/)} @all;
>
> You're asking about how to bind a pattern to a variable:
>
>   $_->[1] =~ /^MA\d/
>
> --
> Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
> RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
> ** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to