#! /usr/bin/perl -w use strict; sub x { # my $one = do { @_ ? shift : 'default' }; # my $two = do { @_ ? shift : 43 }; my $one = do { my $arg = shift; defined($arg) ? $arg : 'default' }; my $two = do { my $arg = shift; defined($arg) ? $arg : 43 }; print "x($one, $two)\n"; } x(); x( 'this' ); x( 1, 2 );