Don't ask to ask, just ask | |
PerlMonks |
Re: Adding Default Values [for BEGINNERS]by ikegami (Patriarch) |
on Dec 21, 2006 at 22:52 UTC ( [id://591214]=note: print w/replies, xml ) | Need Help?? |
$file0 is not blank. It contains \n. Just use chomp to remove the newline before checking if the variable is "empty".
The above will also use the default if 0 (zero) is entered. The following avoids that problem:
By the way, you really, really, really should use use strict; and use warnings;.
In Section
Seekers of Perl Wisdom
|
|