[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: perl: problem with s/// and variable interpolation



Darren/Torin/Who Ever... writes:
 > Two things:
 > 1) If you want stuff on the right hand side to eval-ed (double
 >    substitute variables), you need to do it yourself.
 >    Note that with:
 >      $TRANSLATION = '\$1;\$2'; $str = "ab";
 >    both
 >      $str =~ s{(.)(.)}{$TRANSLATION}ee;
 >    and
 >      eval {$str =~ s{(.)(.)}{$TRANSLATION}; };
 >    are faster than:
 >      eval "\$str =~ s{(.)(.)}{$TRANSLATION}";

Good thing to know.  Thanks.

-- 
Yann Dirson  <ydirson@a2points.com>      | Stop making M$-Bill richer & richer,
alt-email:     <dirson@univ-mlv.fr>      |     support Debian GNU/Linux:
debian-email:   <dirson@debian.org>      |         more powerful, more stable !
http://www.a2points.com/homepage/3475232 | Check <http://www.debian.org/>


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: