Hi,
How about this :-

foreach (@Treasures){
   if ($_=~  /:1:2:3:/){
       print "do your stuffs here\n":
   }
}

----- Original Message ----- From: "Lou Hernsen" <[EMAIL PROTECTED]>
To: <beginners@perl.org>; <[EMAIL PROTECTED]>
Sent: Thursday, April 10, 2008 1:07 AM
Subject: Testing an array for a match


Hallo

I have an array
@Treasures
and I want to match anywhere in it for
/:1:2:3:/
can I
if (@Treasures =~ /:1:2:3:/){}
or do i have to change (@Treasures to $Treasures and then
$Treasures = @Treasures ;
if ($Treasures =~ /:1:2:3:/){}

Just thought I'd ask first, I have to take mother in law to Dr. so I don't
have time to test right now...
I'll check email in a few hours...
thanks
Lou


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to