Date: 09 Sep 2001 13:21:54 -0700 From: merlyn@stonehenge.com (Randal L. Schwartz) Subject: Re: printing all even || odd numbers from array Message-Id: >>>>> "GunneR" == GunneR writes: GunneR> @array1 = qw(1 2 3 4 5 6); [...] GunneR> Want it to print "2 4 6" for (0..10) { my @array1 = (1..$_); print "$_: >@array1[map 1+2*$_, 0..($#array1-1)/2]<\n"; } results in... 0: >< 1: >< 2: >2< 3: >2< 4: >2 4< 5: >2 4< 6: >2 4 6< 7: >2 4 6< 8: >2 4 6 8< 9: >2 4 6 8< 10: >2 4 6 8 10< -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!