Hi ,
You do not need a atoi function in Perl. All the strings can be used as a
number based on the context.
for example
$str1 = '50';
$str2 = '2';
$sum = $num1 + $num2; # sum is now 52
$str_cat = $num1.$num2; #str_cat is 502
HTH,
Chetak
-Original Message-
From: A Madhusudan-A532
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