Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Splitting a Text File

by hdb (Monsignor)
on Jul 26, 2013 at 16:45 UTC ( [id://1046559]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my $file = "start<<<<part2>>>>middle<<<<part3>>>>end";
    my @parts = split /<<<<(.+?)>>>>/, $file;
    print Dumper \@parts;
    
  2. or download this
    $VAR1 = [
              'start',
    ...
              'part3',
              'end'
            ];
    

Log In?
Username:
Password:

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

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

    No recent polls found