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

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.

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