in reply to User input at runtime
#!/usr/bin/perl use strict; use warnings; use IO::Prompt; my $example = "Example"; ( prompt "Enter your choice [y/n] : ", -yes_no ) ? print uc($example), "\n" : print lc($example), "\n";
HTH,OUTPUT : Enter your choice [y/n] : y EXAMPLE Enter your choice [y/n] : n example Enter your choice [y/n] : (Please answer 'y' or 'n')
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: User input at runtime
by andreas1234567 (Vicar) on Dec 13, 2007 at 09:08 UTC |