use vars qw($Bin $Script); BEGIN { ($Bin, $Script) = split /([^\/\\]+)$/, $0 } chdir $Bin . $ARGV[0];