Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Printing a String (TOO stupid?)

by AnomalousMonk (Archbishop)
on Jun 18, 2014 at 07:47 UTC ( [id://1090266]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Printing a String (TOO stupid?)
in thread Printing a String (TOO stupid?)

Probably the best approach would be to do a proper system-to-system transfer in the first place. (Update: On second thought, see below for probable BP.) E.g., the ftp utility common to most (all?) OSen has an ascii mode (automatic line-end translation) as well as a binary (don't touch nuthin') mode.

Otherwise, doing something like
    $line =~ s{ [\x0d\x0a]+ \z }{}xms;
to each and every line would do the trick to eliminate any possible combination of  \x0d and  \x0a characters from the end of the line. Other regexes can handle more particular combinations of line-enders.

Replies are listed 'Best First'.
Re^4: Printing a String (TOO stupid?)
by Corion (Patriarch) on Jun 18, 2014 at 07:54 UTC

    Ugh. I prefer transfers to remain as dumb as possible, as usually somebody switches to compressed files instead of text files somewhere down the road. Also, finding out whether two data deliveries are the same becomes really hard if their checksums and filesizes don't match at either end.

    So I'm firmly in the latter camp of doing the conversion in Perl instead of doing the conversion at transfer time.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-03-19 10:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found