in reply to Array Search
You're confusing grep() with UNIX's grep utility. check out perldoc -f grep, and you will see. You're also slurping <FILE>...
Here's another way to do it...
while( <FILE> ) { if( my $pos = index( $_, '--foo' ) ) { $pos += 5; print substr( $_, $pos, length($_) - $pos ); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Array Search
by rob_au (Abbot) on Nov 14, 2001 at 07:44 UTC |