Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Ksh

by tbone1 (Monsignor)
on Aug 02, 2002 at 14:23 UTC ( [id://187096]=note: print w/replies, xml ) Need Help??


in reply to Ksh style select menus in perl

Am I missing something, or could the select be translated to:
foreach $varname (@list) { whatever }

Or do I need to drink better coffee in the mornings?

--
As God is my witness, I thought turkeys could fly.

Replies are listed 'Best First'.
Re: Re: Ksh
by ash (Monk) on Aug 02, 2002 at 15:19 UTC
    :)
    I think you should lay off the DMT -- Ash/asksh <ask@unixmonks.net>
Re: Re: Ksh
by yumpy (Sexton) on Sep 05, 2002 at 18:20 UTC
    As a matter of fact, you're only missing one thing -- the whole point! The foreach loop loads each list element into $varname. In contrast, the select loop interactively asks the user which element should be loaded for the next iteration! As you can see, these are totally different in behavior, despite the only visible difference being the change from the keyword foreach to select.

    Tim Maher
    tim@teachmeperl.com

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found