|
|
| No such thing as a small change | |
| PerlMonks |
Re: Simple Perl Backup helpby davido (Bishop) |
| on Aug 03, 2012 at 19:46 UTC ( #985336=note: print w/ replies, xml ) | Need Help?? |
|
A lot of your input code can be reduced to:
...by using IO::Prompt::Tiny. Then your user-input code could be reduced to the following:
You could also warn instead of die if one or more backups failed, and then just keep on processing the rest (or prompt for what to do).<?p> prompt() is convenient to use anywhere that user input is desired. If you need stronger input validation, IO::Prompt provides a richer set of tools, but adds some complexity. Dave
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||