in reply to Validating command-line _parameters_ (not options)

Your test will look for a "false" value of either thing. That use of && itself triggers the warning! Say
if (!defined($username) || !defined($dominio))
for the effect you want.

Or, I'll just report on how many arguments there are in the first place.

if (scalar(@ARGV) != 2)
(more often a range of legal values)

—John

Replies are listed 'Best First'.
Re: Re: Validating command-line _parameters_ (not options)
by dserodio (Novice) on Sep 15, 2001 at 02:10 UTC
    I tried using
    if (!defined ($username) || !defined ($domain))
    But I'm still getting the same warnings.
      Maybe the split is causing the warning if ARGV[0] is undefined. Check for the presence of a parameter first!

      make sure @ARGV contains exactly one element.
      split ARGV[0] at the @
      Make sure the split gave you both parts.