Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Passing input through a hash then displaying results

by shmem (Chancellor)
on Jan 23, 2007 at 09:54 UTC ( [id://596058]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    %scores = (
       "wibble<=90" => "A",
       ...
    );
    
  2. or download this
    $grade = <STDIN>;
    ...
    foreach $grade (%scores) {
    
  3. or download this
    foreach my $key (keys %hash) {
        ...
    }
    
  4. or download this
    foreach my $value (values %hash) {
        ...
    }
    
  5. or download this
    chomp (my $grade = <STDIN>);
    $grade !~ /^\d+$/ and die "Input must be numeric!\n";
    ...
        }
    }
    print $result,$/;
    
  6. or download this
    chomp (my $grade = <STDIN>);
    $grade !~ /^\d+$/ and die "Input must be numeric!\n";
    ...
        }
    }
    print $result, $/;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-23 21:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found