On May 30, Craig Moynes/Markham/IBM said:

>I have a script that when it runs (with no parameters) I have warnings
>displayed (we have all seen them but) :
>
>>Use of uninitialized value at ./log_prune.pl line 14.

Because @ARGV is empty, $ARGV[0] is undef.

>if ( (-T $ARGV[0]) )

Use:

  if (@ARGV and -T $ARGV[0]) { ... }

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
** I need a publisher for my book "Learning Perl's Regular Expressions" **

Reply via email to