$foo = @ARGV ? shift : 1;
(I think you may have the 1 and shift switched.)
In reply to Re^3: fun(?) with += by Rhose in thread fun(?) with += by Anonymous Monk