For a script I made recently to manage contacts to my LDAP server on the command line, I needed a package to easily output a prompt to the terminal. The requirement is to be able to output things very easily and giving a default value that will be returned. After checking out some packages at CPAN, I decided to go for Term::Prompt. It offer a very convenient interface, basic checks for the returned value and works as I like it to. The code
Will output first name [default John Doe] There's just one thing that took a while to figure out: Some prompt don't really need an input of course, e.g. not all phone numbers shall be filled and there is not default value. But reading the perldoc carefully revealed that you simply have to use capitalise prompt types.
OK, as ususal RTFM helps... Trackback URL for this post:http://www.schnuckelig.eu/trackback/113
|
|||
Technorati Tags: 









