in reply to Re: Variable Interpolation
in thread Variable Interpolation

ok, i'll bite. certainly running "perl -d cheese.pl" didn't educate me much....
debugger output: ... main::(cheese.pl:4): my $need_to_interpolate = "smell my %s\n"; DB<1> s main::(cheese.pl:5): printf $need_to_interpolate, $string; DB<1> x %s empty array ....

How does the empty hash work, here?

Replies are listed 'Best First'.
Re^3: Variable Interpolation
by trammell (Priest) on Apr 29, 2005 at 20:49 UTC
    From perldoc -f sprintf:
    Perl's "sprintf" permits the following universally-known
    conversions:
       %%   a percent sign
       %c   a character with the given number
       %s   a string
       ...
    
      Anguished 'd'uh! /me is shamed, especially since I spent quite while puzzling about the use of printf, and still didn't stumble on the $s being conversion sted some undeclared and empty hash.

      Interesting warning there, in how I let -d output shape my train of thought.