Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: A Case with 5 Var's

by Fletch (Chancellor)
on Jan 25, 2007 at 13:36 UTC ( #596472=note: print w/replies, xml ) Need Help??


in reply to Re: A Case with 5 Var's
in thread A Case with 5 Var's

Or more succinctly:

my @found = grep exists $my_hash{ $_ }, qw( name vorname plz tel tel49 + );

Update: Good point below. Omit the exists if that's the desired behavior. MENTAL NOTE: NO POSTING OR UPDATING NODES BEFORE CAFFEINE TAKES EFFECT.

Replies are listed 'Best First'.
Re^3: A Case with 5 Var's
by dorward (Curate) on Jan 25, 2007 at 13:43 UTC

    The original code doesn't consider an empty string to be "found", but exists will.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://596472]
help
Chatterbox?
Discipulus Good day bros?!? oh tempora oh mores!
[amitkumarj441]: Hey everyone
[amitkumarj441]: I need to ask a question, where can I post my problem?
[Discipulus]: everyone is me

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-04-26 20:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (488 votes). Check out past polls.