Actually, I think that currently I'd write your code like thismy $ref_mail = shift; my $db_write = @_ ? shift : 1;
That's icky, as it means more to change if there are ever more parameters than just these two. I'd suggest:
my $ref_mail = shift; my $db_write = defined $_[0] ? shift : 1;
In reply to Re^2: Pass an optional parameter to a subroutine
by radiantmatrix
in thread Pass an optional parameter to a subroutine
by ocs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |