Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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

by AnomalousMonk (Chancellor)
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.

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1090266]
and one hand claps...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2018-06-20 21:22 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.