[Chicago-talk] humbling question

crap at mooresystems.com crap at mooresystems.com
Wed Sep 19 06:53:33 PDT 2007


On Wed, Sep 19, 2007 at 06:18:03AM -0700, Richard Reina wrote:
> I am trying to write a simple program like the one below that lets
> users at a console select an active employee.  However, because they
> are not supposed to see the employee's employee number I can't
> figure out a way to let them make the selection.  I thought I could
> do it with a counter ($i) but don't know of a way to associate the
> date with the count.  Any ideas would be greatfully appreciated.

Hi Richard - 

In a situation like this, I often use Damian Conway's IO::Prompt
module. You can pass it a data structure full of the possible options
and it will ask the user to choose one. The documentation is not so
hot, but check the examples directory in the distribution, like
examples/menu.pl.

Hope it helps!

-Andy

PS - I hope it's OK for out-of-towners to chime in occasionally. I
tend to lurk on the YAPC host town's list and haven't unsubscribed
since 2006. Now I don't have to!






More information about the Chicago-talk mailing list