in reply to Match pattern per line and after another one as multiline in single file opening
Incidentally, you have a $data = <$FH>; peppered into your first chunk. Are you meaning to dump the first line of the file? I've included that behavior, but it smells buggy to me.open my $FH, '<' , $config or die "Cannot open $config: $!\n"; my $data = <$FH>; # Dump the line $data = ''; while (<$FH>) { next if /^\s*#|^$/; $data .= $_; } close $FH; while ($data =~ m/\{([^}]*)\}/gx ) { print "$1\n"; }
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
|
|---|