[Israel.pm] regex substitue with lookup table

Yossi.Itzkovich at ecitele.com Yossi.Itzkovich at ecitele.com
Sat Mar 27 21:36:58 PST 2004


Hi,

I have a code that looks like this:

if (/someText (.+?) someMoreText (\d+)/)
{
      if (exists $hash{$2})
      {
            my $newStr=$hash{$2};
            s/someText $newStr someMoreText/;
      }
}

I know There Is Another Way To Do It, and even a shorter one - how ?

Thanks

Yossi




More information about the Perl mailing list