Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm attempting to do the following, be receive the following error: "Use of uninitialized value in pattern match (m//)"
If i remove the variable declaration and work from $_ with the following code everything works fine.
How do I make it work with the first example of code?
foreach my $line (<FILE>) { if ($line =~ /PatternBegin/ .. /PatternEnd/) { $str .= $line; } }
If i remove the variable declaration and work from $_ with the following code everything works fine.
foreach (<FILE>) { if (/PatternBegin/ .. /PatternEnd/) { $str .= $_; } }
How do I make it work with the first example of code?
Back to
Seekers of Perl Wisdom