Re: using variables in a translation

2010-11-30 Thread John
Try: eval "\$test =~ y/$x/$y/;"; Perfect. Thanks, John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: using variables in a translation

2010-11-30 Thread Shawn H Corey
On 10-11-29 11:51 PM, John wrote: I tried using that, but $test wasn't changed here: $test = "This is a test."; $x = "is"; $y = "si"; eval $test =~ y/$x/$y/; print "$test\n"; Try: eval "\$test =~ y/$x/$y/;"; -- Just my 0.0002 million dollars worth, Shawn P

Re: using variables in a translation

2010-11-29 Thread John
Is there a way to use variables in a translation? I'm looking for a way to use, for example, $x = "abc" and $y = "ABC" so something like y/$x/$y/; behave like y/[abc]/[ABC]/; The tr/// operator doesn't interpolate so you have to do something like: eval y/$x/$y/; I tried using that, but $t

Re: using variables in a translation

2010-11-29 Thread Uri Guttman
> "JWK" == John W Krahn writes: JWK> John W. Krahn wrote: >> John wrote: >>> Is there a way to use variables in a translation? I'm looking for a way >>> to use, for example, $x = "abc" and $y = "ABC" so something like >> >> eval y/$x/$y/; JWK> Oops! you forgot to oops that li

Re: using variables in a translation

2010-11-29 Thread John W. Krahn
John W. Krahn wrote: John wrote: Is there a way to use variables in a translation? I'm looking for a way to use, for example, $x = "abc" and $y = "ABC" so something like y/$x/$y/; behave like y/[abc]/[ABC]/; The tr/// operator doesn't interpolate so you have to do something like: eval y/$x

Re: using variables in a translation

2010-11-29 Thread John W. Krahn
John wrote: Is there a way to use variables in a translation? I'm looking for a way to use, for example, $x = "abc" and $y = "ABC" so something like y/$x/$y/; behave like y/[abc]/[ABC]/; The tr/// operator doesn't interpolate so you have to do something like: eval y/$x/$y/; Or perhaps: m

using variables in a translation

2010-11-29 Thread John
Is there a way to use variables in a translation? I'm looking for a way to use, for example, $x = "abc" and $y = "ABC" so something like y/$x/$y/; behave like y/[abc]/[ABC]/; Thanks, John -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-