Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by AnomalousMonk (Abbot)
on Jun 18, 2014 at 07:47 UTC ( #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.


Comment on Re^3: Printing a String (TOO stupid?)
Select or Download Code
Re^4: Printing a String (TOO stupid?)
by Corion (Pope) 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
Node Status?
node history
Node Type: note [id://1090266]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2014-12-19 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (83 votes), past polls