Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Making escape (\) ordinary in double quotes

by AnomalousMonk (Archbishop)
on Apr 09, 2013 at 09:34 UTC ( [id://1027688]=note: print w/replies, xml ) Need Help??


in reply to Making escape (\) ordinary in double quotes

sprintf does not alter the interpolation behavior of a double-quoted string, but it does provide all the interpolation capability of double-quoting – and more! See the many format specifiers in the docs.

>perl -wMstrict -le "my $foo = 'Foo'; my $bar = 'Bar'; ;; my $x = sprintf 'ignore \slash, expand %s, %s.', $foo, $bar; print qq{'$x'}; " 'ignore \slash, expand Foo, Bar.'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-24 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found