$num=$num-0;

You don't need to do this in Perl. There is no distinction between an
integer and a string. It's just a scalar. <OT>This is something you would
have to do in Javascript though.</OT>

John

-----Original Message-----
From: walter valenti [mailto:[EMAIL PROTECTED]]
Sent: 22 February 2002 12:12
To: kitti
Cc: [EMAIL PROTECTED]
Subject: Re: convert array to integer


kitti wrote:

>how to convert array to integer
>
>$array[0]=5
>$array[1]=6
>$array[2]=7
>$array[3]=8
>
>change to integer 5678 for calculate 5678+2=5680
>
>thanks,
>
In not much elegant...

foreach(@array){
    $num.=$_;
}

$num=$num-0;



    Walter



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to