Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Extracting single element from array to be printed in a one liner hash

by moritz (Cardinal)
on May 20, 2014 at 14:07 UTC ( [id://1086792]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Extracting single element from array to be printed in a one liner hash
in thread Extracting single element from array to be printed in a one liner hash

To get rid of the warnings, you can write

if (defined $data{$key} && $data{$key} eq $input) { ... }

Also, please do read, understand and apply Writeup Formatting Tips.

  • Comment on Re^3: Extracting single element from array to be printed in a one liner hash
  • Download Code

Replies are listed 'Best First'.
Re^4: Extracting single element from array to be printed in a one liner hash
by Lotus1 (Vicar) on May 20, 2014 at 17:47 UTC

    The OP wanted to type apples for example and have it say "fruits". To do this you need:

    if ( $key eq $input ) { ... }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-19 11:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found