in reply to Exiting a program
Before I got hooked on Pod::Usage, my default template for command-line perl scripts included a line like:
and I would always put option flags, file args, etc, into that string, making it multi-line where appropriate, and if my arg checking indicated a need to give up (e.g. Getopt::Long returned false or some ad-hoc condition failed) that would lead to die $Usage;my $Usage = "Usage: $0 \n";
But Pod::Usage is better, especially if you are in the (very good) habit of providing a decent POD man page in your command-line scripts, and you want to make it easy for users to see the man page.
With my old habit, I usually regretted having to repeat the content of my "$Usage" variable in the "SYNOPSIS" section of POD. With Pod::Usage, I just have the SYNOPSIS section in POD (no redundant "$Usage" variable).
|
|---|