Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Reading "slices" out of a file at known start markers

by jwkrahn (Monsignor)
on Oct 03, 2008 at 14:29 UTC ( #715198=note: print w/replies, xml ) Need Help??


in reply to Reading "slices" out of a file at known start markers

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;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://715198]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2021-02-27 01:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?