Re: array question



On Tue, Feb 26, 2008 at 10:07 AM, <Irfan.Sayed@xxxxxxxxxxxxx> wrote:
Hello All,



I have two arrays contains exact no. of elements. Now what I need to do
is , I want to execute certain commands to each elements of the array at
a time.

@array1 = (1,2,3);
@array2 = (4,5,6);

for (my $i=0; $i < scalar(@array1); $i++) {
print $array1[$i], $array2[$i], "\n";
}

is straight forward enough.

Troy
.



Relevant Pages

  • Re: [opensuse] Replying to threads (was: Re: OT: bash F1)
    ... If the topic was so unworthy of defense, the voluminous outpouring was ... To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx ... For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx ... People who start their arrays with 1. ...
    (SuSE)
  • Re: Whos Responsible For The 49+ CAS?
    ... A bit more about the CAS and its commands: ... "The CAS" is a separate section of the entire ROM, ... handle "symbolic arrays" (arrays were originally numeric only ... cylindrical or spherical coordinates, with "angle symbols" ...
    (comp.sys.hp48)
  • RE: cciss updates for 2.6.6xxx [1/2]
    ... I like the idea of capping max commands based on the number of arrays. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: multiplying arrays
    ... Here is a quick and dirty little program that should do the trick: ... I believe all of these commands are built into the 48G. ...
    (comp.sys.hp48)
  • D1000, A1000 and A5200
    ... commands to identify the position of each disk into the Arrays? ... Best Regards ...
    (SunManagers)