in reply to Re: Correct idiom for default parameters
in thread Correct idiom for default parameters

What about the more obvious following?

sub test{ my $p1 = shift || 1; [...]

Replies are listed 'Best First'.
Re^3: Correct idiom for default parameters
by BrowserUk (Patriarch) on Apr 29, 2010 at 10:51 UTC

    Suffers because you cannot set $p1 explicitly to 0 (or '' or undef). That's why 5.10 has //.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.