Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: hash problems

by changma_ha (Sexton)
on Sep 21, 2010 at 06:25 UTC ( [id://861005]=note: print w/replies, xml ) Need Help??


in reply to hash problems

Hi Weglarz . Hope the following code will help

#! /usr/bin/perl use strict; use warnings; use Data::Dumper; my %passwords = ("Matt", "s1k1d52", "scuzzy", "2ab928", "Marky", "s829 +1s", "Jeb", "jeb23"); delete $passwords{"jeb"}; if(exists $passwords{Matt}){ print($passwords{Matt}. "is my password.\n"); } if(defined $passwords{scuzzy}){ print($passwords{scuzzy} . " IS defined!\n"); }else{ print("%passwords are everyone's passwords!\n"); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-09-09 02:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.