Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Best practice on escapes in interpolated strings

by Dallaylaen (Monk)
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 drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-07-31 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls