You need to declare the variable $date outside of either of the blocks created by the if/else statement.
--my $date; if (@ARGV) { $date = 'something'; } else { $date = 'something else'; }
Perl Training in the UK <http://www.iterative-software.com>
In reply to Re: Copying a value from an element in the ARGV array to a variable...
by davorg
in thread Copying a value from an element in the ARGV array to a variable...
by joelw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |