in reply to Re^2: String related question
in thread String related question
Your error is that you're trying to apply the match to the whole array of lines at once, instead of to each line individually. Try this as a correction to your code:
foreach my $line (@array) { if($line =~/^AD/){ print " $line"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: String related question
by vikuuu (Novice) on Feb 02, 2011 at 14:12 UTC | |
by marto (Cardinal) on Feb 02, 2011 at 14:28 UTC | |
by moritz (Cardinal) on Feb 03, 2011 at 09:04 UTC |