P is for Practical | |
PerlMonks |
Re: Pass an optional parameter to a subroutineby robartes (Priest) |
on Sep 15, 2006 at 08:17 UTC ( [id://573069]=note: print w/replies, xml ) | Need Help?? |
You're being bitten by the fact that 0 is false, so if you pass 0 in $db_write, the shift || 1 sees false || 1 and you get 1. You will probably want to explicitely check for definedness instead:
CU
In Section
Seekers of Perl Wisdom
|
|