Re: substitute math

2008-12-20 Thread Owen
> Hi, > > I have a variable for which I ultimately want to substitute w/ some > math. Is there a way to get the result "6"? > > my $number=123; > $number =~s/123/1+2+3/s; #This method results in "1+2+3", not the "6" > I am looking for > print "$number"; Run this program and see if you can see wha

Re: substitute math

2008-12-20 Thread Chas. Owens
On Sat, Dec 20, 2008 at 01:04, hotkitty wrote: > Hi, > > I have a variable for which I ultimately want to substitute w/ some > math. Is there a way to get the result "6"? > > my $number=123; > $number =~s/123/1+2+3/s; #This method results in "1+2+3", not the "6" > I am looking for > print "$number

substitute math

2008-12-20 Thread hotkitty
Hi, I have a variable for which I ultimately want to substitute w/ some math. Is there a way to get the result "6"? my $number=123; $number =~s/123/1+2+3/s; #This method results in "1+2+3", not the "6" I am looking for print "$number"; -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org