in reply to Re^2: Formating a printf statement using a variable
in thread Formating a printf statement using a variable

Even better! Thank you! One less line and variable! I didn't know you could do that! ;-)

  • Comment on Re: Re^2: Formating a printf statement using a variable

Replies are listed 'Best First'.
Re^4: Formating a printf statement using a variable
by Aristotle (Chancellor) on Jan 12, 2003 at 00:19 UTC
    Yep, very handy when you have something like my $type = $cond ? 'book' : 'module'; and want to print "books" or "modules": print "${type}s";. The straightforward print "$types"; will have strict complaining about an unknown $types.. although the curlies are very ugly extra linenoise, so in some cases (like this one) I'd prefer to say print $type . 's'; instead. But as with everything Perl: TMTOWTDI. :)

    Makeshifts last the longest.