Without any optmisation :), try this: #!/usr/bin/perl -w use strict; use Data::Dumper;
my @array1 = ("0", "5", "7"); my @array2 = ("10", "20", "21"); my @array3 = ("2", "25", "4"); my @res=(); my $i; for($i=0;$i<3;$i++){ $res[$i]=$array1[$i] + $array2[$i] + $array3[$i]; } print Dumper([EMAIL PROTECTED]); __END__ Result is: $VAR1 = [ '12', '50', '32' ]; José. > -----Original Message----- > From: Geer, David van der [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 27, 2003 12:35 PM > To: [EMAIL PROTECTED] > Subject: Calculate the values of 3 arrays to one > > > Hi, > > Is it possible to calculate the values of 3 arrays ? > So : > > @array1 = ("0", "5", "7"); > @array2 = ("10", "20", "21"); > @array3 = ("2", "25", "4"); > > Now I want to be able to plus each fist value, second value, > etc. So that the outcome will be : > > @arraytotal = ("12", "50", "32"); > > Any help will be much apreciated !1 > > > Regs David > > > ********************************************************************* > This message is intended only for the person or entity to > which it is addressed and may contain confidential and/or > privileged information, the disclosure of which is > prohibited. If you are not the intended recipient you may not read, > use, disseminate or copy the information transmitted. If > you have received this message in error, please contact > the sender and delete the material from any computer. > Dit bericht is uitsluitend bestemd voor de (rechts)persoon > aan welke het is gericht. Het kan vertrouwelijke of > alleen voor deze bestemde informatie bevatten, die niet > mag worden geopenbaard. Als dit bericht niet voor u > bestemd is, mag u de ontvangen informatie niet lezen, > gebruiken, verspreiden of kopieren. Als u dit bericht > abusievelijk hebt ontvangen, gelieve u het te deleten en > contact op te nemen met de afzender. > ******************************************************************** > > > > ********************************************************************** > This email and any files transmitted with it are confidential > and intended solely for the use of the individual or entity > to whom they are addressed. If you have received this email > in error please notify the system manager. > > This footnote also confirms that this email message has been > swept by MIMEsweeper for the presence of computer viruses. > www.mimesweeper.com ********************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] **** DISCLAIMER **** "This e-mail and any attachment thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the recipient(s) named above. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication or distribution in any form) by other persons than the designated recipient(s) is prohibited. If you have received this e-mail in error, please notify the sender either by telephone or by e-mail and delete the material from any computer". Thank you for your cooperation. For further information about Proximus mobile phone services please see our website at http://www.proximus.be or refer to any Proximus agent. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]