mandog has asked for the wisdom of the Perl Monks concerning the following question:
I've gotten in the habit of creating error messages like this:
use strict ; use Getopt::Long; my ($username,$password,$group); my $err_msg=''; GetOptions('u=s' => \$username,'g=s'=> \$group, 'p=s'=>\$password); $err_msg.="missing -u username\n" unless $username; $err_msg.="missing -g group\n" unless $group; $err_msg.="missing -p password\n" unless $password; die "$err_msg" if $err_msg;
It works without obvious errors, but somehow this feels wrong...
Am I missing something...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: .= $err_msg
by particle (Vicar) on Apr 27, 2002 at 03:18 UTC | |
by chip (Curate) on Apr 27, 2002 at 06:04 UTC | |
|
Re: .= $err_msg
by BUU (Prior) on Apr 27, 2002 at 02:11 UTC |