Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How to make a variable in a single line

by rovf (Priest)
on Jun 05, 2013 at 12:30 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-26 06:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found