Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating shell menus using perl 1

Status
Not open for further replies.

veteq

Technical User
Dec 7, 2004
23
CA
I just started to program in Perl,

One of the first program that I will be working on will need to display a menu on a telnet session, what is the best way to do this in perl

e.g

1) option abc
2) option def
3) .....
enter your selection:

up to 10 options.....

any help would be greatly appreciated....

Veteq
 
Hello Veteq,

Are you having trouble with any particular part of your menu script?

Mike

To err is human,
but to really foul things up -
you require a man Mike.

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
thank you for your quick reply,

no, right now I am using a IF stmt to point to the selected option but I was wondering is there is a better way to do it?

if ( $ans == 1 ) {

} elsif {

}

and so on
 
Veteq,

I've done a few menu systems using Perl - though not for a long time now I have to say - all using your method.

if($ans==1){
}elsif($ans==2){
}elsif($ans==3){
}elsif($ans==4){
}elsif($ans==5){
}else{
}

Mike

To err is human,
but to really foul things up -
you require a man Mike.

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
I thought I posted this already, but obviously I messed up somewhere.....
Check out the ANSI::Menu module. It's probably more than you need but it looks relatively easy to use.

 
thank you very much for all your help,

I sure am glad I found this forum,,,,,

thank u

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top