Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Newbie - convert carriage return in a variable

by poj (Abbot)
on Feb 17, 2019 at 18:09 UTC ( [id://1230049]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Newbie - convert carriage return in a variable
in thread [Solved]Newbie - convert carriage return in a variable

Add the g modifier to your regex

#!perl use strict; my $text = 'foo bar'; $text =~ s/\n/<br \/>/g; print $text;
poj

Replies are listed 'Best First'.
Re^4: Newbie - convert carriage return in a variable
by Balawoo (Novice) on Feb 17, 2019 at 19:06 UTC
    Thanks @poj It's solved

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2024-04-19 09:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found