On Fri, Jun 18, 2004 at 06:03:34PM +0530, A Madhusudan-A5324C wrote:

> Does anyone know how to convert string into Number in Perl. Just like
> the classic atoi function of C.

Yep.  perl does.

If you want something to be a number, use it as one.

$ perl -le '$a = "0.36"; $b = "2.456e3 or so"; $c = $a + $b; print $c'
2456.36

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to