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

Re^3: Perl ignores CarriageReturn during fileparsing. Why?

by space_monk (Chaplain)
on Jun 13, 2013 at 12:29 UTC ( #1038734=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Perl ignores CarriageReturn during fileparsing. Why?
in thread Perl ignores CarriageReturn during fileparsing. Why?

Normally the input record separator should only be changed in the scope for which you need to change it

# code "borrowed" from node 1952 :-) { local $/ = undef; open FILE, "myfile" or die "Couldn't open file: $!"; $string = <FILE>; close FILE; } # $/ reverts back to default here...
If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)


Comment on Re^3: Perl ignores CarriageReturn during fileparsing. Why?
Download Code
Re^4: Perl ignores CarriageReturn during fileparsing. Why?
by hoppfrosch (Scribe) on Jun 13, 2013 at 13:52 UTC
    The change happened by accident and not intentional - until now I wasn't able to locate the change within my own code. Perhaps it happens somewhere in an external perl module ....

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2014-04-18 10:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (465 votes), past polls