#!/usr/bin/perl -w use strict; use List::MoreUtils qw(any); use List::Util qw(shuffle); my ( @one, @two, @three, @four ); my @arrays = ( \@one, \@two, \@three, \@four ); map { @$_ = shuffle map { int rand 10 } 1 .. 500; } @arrays; # If >any< one of these scalar values (in any array) are equal # to z +ero then execute the following code map { print "Zero found!\n" if any { $_ == 0 } @$_ } @arrays;
hth,
PooLpi
In reply to Re: "Or" in Array
by poolpi
in thread "Or" in Array
by hoffmann
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |