On Wed, 17 Nov 2004 14:54:13 +0100, Gunnar Hjalmarsson <[EMAIL PROTECTED]>
wrote:
3) Why use a regexp at all?
print 'Yes it exists' if grep $mystring eq $_, @myarray;
4) Why continue looping through the whole array when a matching element
has been found?
for (@myarray) {
print 'Yes it exists' and last if $mystring eq $_;
}
Thanks so much guys.
Glad I learnt those...
--
Regards,
Edward WIJAYA
SINGAPORE
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>