Shaun Fryer wrote:
>
> Try this little baby.
Why?
> @array = (5, 6, 7, 8);
> $integer = print(@array);
> chop($integer);
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Try this little baby.
@array = (5, 6, 7, 8);
$integer = print(@array);
chop($integer);
===
Shaun Fryer
===
London Webmasters
http://LWEB.NET
PH: 519-858-9660
FX: 519-858-9024
===
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additiona
: 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
>
one way to do it is:
my @array = (5, 6, 7, 8);
my $some_val;
$some_val .= $_ for (@array);
an
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
$ perl -le'
@array = qw(5 6 7 8);
print 5678 + 2;
print join( &quo
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
array = qw(5 6 7 8);
my $total;
foreach (@array) {
$total .= $_;
}
$total += 2;
print $total;
HTH
John
-Original Message-
From: kitti [mailto:[EMAIL PROTECTED]]
Sent: 22 February 2002 11:47
To: [EMAIL PROTECTED]
Subject: convert array to integer
how to 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
-
kitti wrote:
>
> how to convert array to integer
>
> $array[0]=5
> $array[1]=6
> $array[2]=7
> $array[3]=8
>
one way to do it is:
my @array = (5, 6, 7, 8);
my $some_val;
$some_val .= $_ for (@array);
another is:
my @array = (5, 6, 7, 8);
my $some_val = "@array&
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,