On Wed, Feb 5, 2014 at 8:11 PM, Uri Guttman <u...@stemsystems.com> wrote: > On 02/05/2014 02:52 PM, Jorge Almeida wrote: >> >> $s="ab"; >> $s=~s/a/AA/; # $s is now "AAb" >> >> >> I would like to achieve the same with something similar to the x >> multiplier: >> >> $n=2; >> $s="A"x$n."b"; # $s is "AAb"
you need the /e modifier on s///. it allows any perl expression to be used > in the replacement part. read http://perldoc.perl.org/perlop.html and look Great! Thanks a lot. Jorge -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/