in reply to (MeowChow) Re: TMTOWTDI isn't best in this case
in thread TMTOWTDI isn't best in this case

Your SELECT will miss this case:
p${b}.zip
which is one of the ones I listed.

And while I'm replying to things, Ovid, the SELECT * was just an example of what I'm doing, I am being explicit about which rows I am getting.

Replies are listed 'Best First'.
(Ovid - did you test this?) Re(3) TMTOWTDI isn't best in this case
by Ovid (Cardinal) on Jul 24, 2001 at 03:41 UTC

    But p${b}.zip is the same as p$b.zip, thus interpolating $b and eliminating the braces. If you're unsure of this, you can do the following:

    my $b=7; print ${b};

    That prints 7, thus making MeowChow's solution a viable one. I know it looks odd, but it's valid Perl and it works with warnings and strict. I'm using 5.6.1. Does this fail on other versions of Perl?

    Cheers,
    Ovid

    Vote for paco!

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

(MeowChow) Re3: TMTOWTDI isn't best in this case
by MeowChow (Vicar) on Jul 24, 2001 at 03:28 UTC
    I originally had it as 'p%b%', but changed it after thinking (apparently incorrectly) that $b was an interpolated value. Implementation trivia notwithstanding, the principle is the same.
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print