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

Re: Best practice on escapes in interpolated strings

by Dallaylaen (Scribe)
on Jul 29, 2013 at 16:16 UTC ( #1046888=note: print w/ replies, xml ) Need Help??


in reply to Best practice on escapes in interpolated strings

I've recently stumbled upon String::Format. Although I haven't used it yet, I believe it to be a possible solution for such cases. In a nutshell:

#!/usr/bin/perl -w use strict; use String::Format qw(stringf); print stringf( "%a->%o->%a\n", a => "apples", o => "oranges" );

I don't know how fast it is, though.

UPDATE: I like the %(foo) solution even more!


Comment on Re: Best practice on escapes in interpolated strings
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2014-11-28 00:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (191 votes), past polls