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

Re: How to make a variable in a single line

by rovf (Priest)
on Jun 05, 2013 at 12:30 UTC ( #1037195=note: print w/replies, xml ) Need Help??


in reply to How to make a variable in a single line

$your_variable_containing_newlines =~ tr/\n\r//d;
UPDATE: typo corrected.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^2: How to make a variable in a single line
by Anonymous Monk on Jun 05, 2013 at 13:11 UTC
    What is \d?

     s{ \R+ }{}gx aka  s{[\x{000A}\x{000C}\x{000D}\x{0085}\x{2028}\x{2029}]+}{}g

      Thanks, I corrected my posting.

      -- 
      Ronald Fischer <ynnor@mm.st>

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2021-10-20 12:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (81 votes). Check out past polls.

    Notices?