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