Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Cross Platform end of Line characters

by adamk (Chaplain)
on Aug 03, 2003 at 04:37 UTC ( #280399=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub slurp {
        my $file = shift or return undef;
    ...
        close FOO;
        return \$buffer;
    }
    
  2. or download this
    my $content = slurp( $file ) or die "Failed to load file";
    my @lines = split /(?:\015\012|\015|\012)/, $$content;
    
  3. or download this
    $$content =~ s/(?:\015\012|\015|\012)/\n/g;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2022-11-30 08:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?