in reply to Re: fun(?) with +=
in thread fun(?) with +=

I'd write that as:
$foo = @ARGV ? 1 : shift;
which, IMO, gives a clearer message that '1' the default if no arguments are given.

Replies are listed 'Best First'.
Re^3: fun(?) with +=
by Rhose (Priest) on Jan 03, 2005 at 16:35 UTC
    Do you mean that you'd write it as:

    $foo = @ARGV ? shift : 1;

    (I think you may have the 1 and shift switched.)