foreach my $line (<FILE>) { if ($line =~ /PatternBegin/ .. /PatternEnd/) { $str .= $line; } }
foreach (<FILE>) { if (/PatternBegin/ .. /PatternEnd/) { $str .= $_; } }
In reply to ranged conditional with variable by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |