Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: newline substitution is removing text too

by japhy (Canon)
on Jan 21, 2007 at 04:37 UTC ( #595724=note: print w/replies, xml ) Need Help??


in reply to newline substitution is removing text too

There are probably also carriage returns in the file as well. tr/\r//d or s/\r//g will remove them.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: newline substitution is removing text too
by Groxx (Novice) on Jan 21, 2007 at 05:35 UTC
    I just ran a /\r/ search of the file, and nothing came up. While I can see this happening, aren't those also converted to "\n" by Perl automatically, unless told to do otherwise? And even if it didn't, would they show up in other applications?

    And even then, why would it be in the middle of a line of text or HTML tag?

    Thanks for the idea, though, I hadn't thought of that possibility.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://595724]
help
Chatterbox?
[Eily]: I just wrote a oneliner to solve a (non perl) colleague's problem, and it worked on the first try
[Eily]: and he wasn't impressed
1nickt adds gingersnaps to the platter on the sideboard.
[Eily]: sure it was a pretty standard one liner (of the $h{$1} = $2 if /regex/; END { pp \%h; } variety), but he's not supposed to know that!
[Eily]: what's the point of writing perl if people aren't impressed :P

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2017-04-26 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (482 votes). Check out past polls.