>>>>> "BD" == Brent Dax <[EMAIL PROTECTED]> writes:

  BD> Uri Guttman:
  BD> #         printf "%d hash is $(%foo.string)", $bar ;
  BD> #
  BD> # no ambiguity and no confusion. how often will you need to
  BD> # interpolate a
  BD> # hash?

  BD> As others have pointed out, %foo{BAR} has to work.  But I have another
  BD> question for you: what's wrong with

  BD>   sprintf '%d hash is %s', $bar, %foo;

that is fine but if you want the format string to use %foo{bar} then you
need double quotes. the problem is deciding when to allow that and to
not make %s become broken. i proposed a possible solution in my previous
post. maybe it won't fall on deaf ears. :)

  BD> ?  After all, interpolating into an sprintf is a bit dangerous anyway
  BD> (what if %foo=('%d' => '')?), and you avoid special cases.

that is another point. not allowing a complete hash to interpolate. but
what defines that? what if you wanted %s{bar} and that was a format and
not a hash and in a double quoted string? my proposal handles that well
with no major noise factors. qn would be just like qq but not allow any
direct hash interpolations (%foo or %foo{bar}). you can always get those
with $() if needed. this solves the common case with a minimal of noise
and the uncommon case has a simple out of using $(). no need for wacko
ways to put in \n. it is double quotish in all ways but one and mainly
to be used for printf format strings.

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
-- Stem is an Open Source Network Development Toolkit and Application Suite -
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
          • ... Brent Dax
            • ... Uri Guttman
              • ... Brent Dax
              • ... Uri Guttman
              • ... Eugene van der Pijll
              • ... Peter Scott
              • ... Uri Guttman
              • ... ianb
        • ... Brent Dax
  • ... Brent Dax
    • ... Uri Guttman
      • ... Rich Morin
        • ... Jim Cromie
          • ... Luke Palmer
            • ... Rich Morin
      • ... Dmitry Kohmanyuk Дмитрий Кохманюк
  • ... Tony Hall

Reply via email to