in reply to Match pattern per line and after another one as multiline in single file opening
it's a bit difficult to be sure what you're trying to do without having some sample input data.
Try perhaps this:
Untested because of the absence of test data.open my $FH, '<' , $config or die "Cannot open $config: $!\n"; my $data = <$FH>; # removing a header line? or what? while (my $line = <$FH>) { next if /^\s*#|^$/; print "$1\n" while $data =~ m/\{([^}]*)\}/gx ; } close $FH;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Match pattern per line and after another one as multiline in single file opening
by kennethk (Abbot) on Feb 14, 2017 at 23:33 UTC | |
by Laurent_R (Canon) on Feb 15, 2017 at 07:20 UTC |