nikhil.patil has asked for the wisdom of the Perl Monks concerning the following question:
How do I make sure that a string value "0" is assigned to $var when the argument passed to the function is 0?sub function1 { $var = shift || "No argument"; print $var . "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to assign string "0" in short circuit
by olus (Curate) on Feb 04, 2008 at 12:28 UTC | |
|
Re: How to assign string "0" in short circuit
by poolpi (Hermit) on Feb 04, 2008 at 13:05 UTC | |
|
Re: How to assign string "0" in short circuit
by BrowserUk (Patriarch) on Feb 04, 2008 at 13:07 UTC | |
|
Re: How to assign string "0" in short circuit
by jwkrahn (Abbot) on Feb 04, 2008 at 12:23 UTC | |
|
Re: How to assign string "0" in short circuit
by saberworks (Curate) on Feb 05, 2008 at 04:56 UTC | |
by nikhil.patil (Sexton) on Feb 05, 2008 at 06:46 UTC | |
by naikonta (Curate) on Feb 05, 2008 at 07:52 UTC |