Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Trying to split a file into array conditionally

by bart (Canon)
on Nov 15, 2011 at 12:04 UTC ( [id://938152]=note: print w/replies, xml ) Need Help??


in reply to Trying to split a file into array conditionally

Perhaps you could only split where the next line doesn't start with an opening square bracket?

split takes a regex, thus this is fairly easy.

@info = split /\n(?!\[)/, $filecontents;

Replies are listed 'Best First'.
Re^2: Trying to split a file into array conditionally
by bobg2011 (Novice) on Nov 16, 2011 at 09:42 UTC
    Thanks guys...... I've gone with brats solution.... it does the trick nicely! cheers! :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-03-28 11:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found