Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
which gives me the whole file in $lines. Now I need to get all lines that satisfy a pattern in $myPattern into an array @patternMatchArray Is there a way to do this quickly other than a line by line approach.open(FILE, "$filename") or die "Cant open $filename\n"; local $/ = undef; my $lines = <FILE>; close(FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: matching lines in multi-line string
by edan (Curate) on Nov 27, 2003 at 12:23 UTC | |
|
Re: matching lines in multi-line string
by CombatSquirrel (Hermit) on Nov 27, 2003 at 13:29 UTC | |
|
Re: matching lines in multi-line string
by jeffa (Bishop) on Nov 27, 2003 at 15:44 UTC | |
|
Re: matching lines in multi-line string
by Roger (Parson) on Nov 27, 2003 at 12:19 UTC | |
by edan (Curate) on Nov 27, 2003 at 12:29 UTC | |
by Roger (Parson) on Nov 27, 2003 at 19:11 UTC |