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

Student Teacher

by nerfherder (Monk)
on Feb 23, 2011 at 08:57 UTC ( #889765=poem: print w/ replies, xml ) Need Help??

#!/opt/bin/perl use Switch; use 5.010; my %is_ready = ('teacher' => "student", 'student' => "teacher"); for(%is_ready){ given($_) { when(/student/) { appear($is_ready{$_}); } when(/teacher/) { appear($is_ready{$_}); } } } sub appear{ $appear = shift; print "$appear is ready, ". $is_ready{$appear} ."\n"; }

Comment on Student Teacher
Download Code
Reaped: Re: Student Teacher
by NodeReaper (Curate) on Mar 16, 2011 at 07:36 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: poem [id://889765]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2014-12-28 15:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls