Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Best practice on escapes in interpolated strings

by Dallaylaen (Pilgrim)
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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1046888]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2017-01-19 21:40 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (172 votes). Check out past polls.