Another way to do it:
while ( <FH> ) { if ( /^SOURCES/ && /\\$/ ) { $_ .= <FH>; redo; } elsif ( /^SOURCES/ ) { print; } }
And yet another way:
my $data; while ( <FH> ) { $data .= $_ if /^SOURCES/ || $data && /^\s/; last if $data && !/\S/; } print $data;
In reply to Re: Reading "slices" out of a file at known start markers
by jwkrahn
in thread Reading "slices" out of a file at known start markers
by hacker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |