Home  |  Linux  | Mysql  | PHP  | XML
From:John W. Krahn Date:Thu Apr 10 01:04:53 2008
Subject:Re: Testing an array for a match
Lou Hernsen wrote:
> Hallo

Hello,

> 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:/){}

if ( grep /:1:2:3:/, @Treasures ) {


John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall
Navigate in group perl.beginners.cgi at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants