sub undeff { @_[0..@_-1] = (); }; $foo = 5; $bar = 8; undeff($foo, $bar); # this undefs both of them print "foo=[$foo] bar=[$bar]\n"; # prints `foo=[] bar=[]' and two warnings