Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Get file part from the section where the matched pattern is found.

by roboticus (Chancellor)
on Nov 29, 2011 at 10:57 UTC ( [id://940582]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
            if($filecontents =~ /\*\sdisks/){
            my @matchsect = /\*\sdisks/;
            print "@matchsect\n\n";
    }
    
  2. or download this
            if ($filecontents =~ /\*\sdisks/) {
                 # delete everything up to the first occurrence
    ...
                 $filecontents =~ s/^.*?\*\sdisks//;
                 print "$filecontents\n\n";
            }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-24 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found