Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: About $/

by gurpreetsingh13 (Scribe)
on May 24, 2013 at 10:34 UTC ( #1035105=note: print w/ replies, xml ) Need Help??


in reply to Re: About $/
in thread About $/

Nested declaration may be what you are looking for.

$/="\r"; my @splitted=(); while(<FH>){ local $/="\003"; push @splitted,split(/$\//,$_); }


Comment on Re^2: About $/
Download Code
Replies are listed 'Best First'.
Re^3: About $/
by Tux (Monsignor) on May 24, 2013 at 13:15 UTC

    No need for the second local $/ and the first can be made even more local:

    my @splitted = do { local $/ = "\r"; map { split m/\003/ => $_, -1 } <>; };

    Enjoy, Have FUN! H.Merijn
Re^3: About $/
by lddzjwwy (Novice) on May 24, 2013 at 10:48 UTC
    This way works very well! Thank you so much! :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2015-08-30 10:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (348 votes), past polls