Just another Perl shrine | |
PerlMonks |
Re: Chomp a numerical expression, return the answer.by Trix606 (Monk) |
on May 18, 2006 at 15:23 UTC ( [id://550256]=note: print w/replies, xml ) | Need Help?? |
Try this:
UPDATE: As blazar points out, while this code does what you want, know that it will blissfully run any valid Perl command. You might add some editing of your input before handing it to eval. Good Luck, Trix
In Section
Seekers of Perl Wisdom
|
|