in reply to Dreaming of Post Interpolation

check out this Interpolation module from M-J. Dominus:
http://www.plover.com/~mjd/perl/Interpolation/

i haven't checked it out myself, but it looks pretty interesting from just looking at the web page.

i don't think that there is a simple, transparent syntax or function for doing what you want in Perl. at the least, you can check out the techniques MJD uses in his Interpolation module and go from there.

most of the time, i use (s)printf for such things, but it does not have the nice feature of explicitly tying the name to the postition as does symbolic variable interpolation (i.e. it's hard to tell which '%s' goes with which variable when there are twenty of them; 'Hello $Recipient' is transparent).

Replies are listed 'Best First'.
RE: Re: Dreaming of Post Interpolation
by BBQ (Curate) on May 30, 2000 at 07:17 UTC
    Dude, congratulations! That was exactly what I was looking for! I wonder why it hasn't been introduced into the core! I can think of 2031 different ways of using the Interpolation.pm (and the name is so damn obvious, I don't know how I never ran across it on CPAN). I'm downloading it now to play with it a bit and see if I can get the desired results from it.

    Thank you, thank you!!

    #!/home/bbq/bin/perl
    # Trust no1!
      i poked around CPAN a bit looking for it, but aside from a few stale references to it's being on CPAN in Google, i couldn't find it there.
        I got it here. It required me to go through search.cpan.org.
        I found it right away with the CPAN shell (once I knew it was there and what to look for):
        perl -MCPAN -e shell cpan> i /Interpolation/ Distribution M/MJ/MJD/Interpolation-0.53.tar.gz Module Interpolation (M/MJ/MJD/Interpolation-0.53.tar.gz)