#!/usr/local/bin/perl use strict; use warnings; my @ARGV = (1,2,3,4); my $dir = defined(my $ARGV[0]) ? shift(@ARVG) : "/tmp"; print $dir;