Better point would be use hash % then you could use the number as a key into
the array like
if ( defined $Holder{$TEST1} ) {
# found, so do something
}else {
# not found do something
}
so you could do:
my %HOLDER = ('020', 1, '040', 1, '034', 1, '056', 1, '030', 1);
if ( defined $Holder{$TEST1} ) {
# found, so do something
}else {
# not found do something
}
-----Original Message-----
From: a p [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 17, 2001 12:56
To: [EMAIL PROTECTED]
Subject: Help - Rookie question on Arrays
Hi,
Today is my first day on Perl so please bear with me if this sounds
stupid...
How can I find out if an array contains a particular element stored in a
certain variable ?
eg variable TEST1 = "030"
array HOLDER = "020 040 034 056 030"
I need to find out if "030" is present in the array HOLDER
Any help on how to do this would be really appreciated.
Thanks
Amit
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com