Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
foreach my $line (<FILE>) { if ($line =~ /PatternBegin/ .. /PatternEnd/) { $str .= $line; } }
foreach (<FILE>) { if (/PatternBegin/ .. /PatternEnd/) { $str .= $_; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ranged conditional with variable
by diotalevi (Canon) on Aug 22, 2006 at 00:04 UTC | |
|
Re: ranged conditional with variable
by ikegami (Patriarch) on Aug 22, 2006 at 05:57 UTC | |
|
Re: ranged conditional with variable
by izut (Chaplain) on Aug 22, 2006 at 11:41 UTC | |
by Hofmator (Curate) on Aug 22, 2006 at 12:11 UTC | |
by izut (Chaplain) on Aug 22, 2006 at 12:29 UTC |