dserodio has asked for the wisdom of the Perl Monks concerning the following question:
However, if I call the script with no parameters, I get 2 "Use of uninitialized value" before the "Usage: ...". Is there some better way to check my commandline parameters? TIA#!/usr/bin/perl -w use strict; my ($username, $domain) = split(/@/, shift); if (! ($username && $dominio)) { $0 =~ s|.*/||; die("Usage: $0 <username\@domain>\n"); } # do actual stuff
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Validating command-line _parameters_ (not options)
by ChemBoy (Priest) on Sep 15, 2001 at 02:32 UTC | |
|
Re: Validating command-line _parameters_ (not options)
by John M. Dlugosz (Monsignor) on Sep 15, 2001 at 01:36 UTC | |
by dserodio (Novice) on Sep 15, 2001 at 02:10 UTC | |
by John M. Dlugosz (Monsignor) on Sep 15, 2001 at 02:25 UTC | |
|
Re: Validating command-line _parameters_ (not options)
by Anonymous Monk on Sep 17, 2001 at 05:38 UTC |