Re: Syntax for grep using regex

2001-10-22 Thread Clinton
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] =~ /^M

Re: Syntax for grep using regex

2001-10-22 Thread Jeff 'japhy' Pinyan
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

Syntax for grep using regex

2001-10-22 Thread Clinton
Hi I would like to use grep on an array to remove rows from an array. If I hard code a variable it works. The regex works on its own but I can't put the two together. @first25 = grep{$_->[1] eq (/^MA\d+/)} @all; Help appreciated Regards CCJ