Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: STDIN method?

by tadman (Prior)
on Oct 18, 2002 at 07:20 UTC ( [id://206234]=note: print w/replies, xml ) Need Help??


in reply to STDIN method?

Something so simple can't help but be golfed:
sub f { my$x;my%x=map{++$x,$_}@_;print"Choose 1 of the $x options:\n",(map{"$_ +=$x{$_}\n"}1..@_),"\nChoose one:\n";chomp($_=<>);$x{$_} } print "Response=".p(qw[ Turkey Steak Apple ]),$/;
You might have to use <STDIN> instead of <> if you have something in @ARGV.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-06-14 22:34 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.