Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

RE: Comparing Scalars and Arrays

by autark (Friar)
on Jul 19, 2000 at 21:31 UTC ( [id://23250]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if( grep { $scalar == $_ } @array ) {
       print "$scalar is member of @array\n";
    } else {
       print "$scalar is not member of @array\n";
    }
    
  2. or download this
    $scalar = 3;
    @array  = ([1, 2], [3, 4, 5], [6, 7, 8 ,9]);
    ...
    } else {
       print "No\n"
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://23250]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2024-04-23 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found