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

Re^4: Passing input through a hash then displaying results

by ikegami (Patriarch)
on Jan 23, 2007 at 07:24 UTC ( [id://596043]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Passing input through a hash then displaying results
in thread Passing input through a hash then displaying results

Sorry, I meant to say "That's why the looping is needed if you use a hash."

Of course, you could just do

sub get_score { my ($score) = @_; return 'A' if $score >= 90; return 'B' if $score >= 80; return 'C' if $score >= 70; return 'D' if $score >= 60; return 'F'; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-24 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found