in reply to adding a variable definition to execution

Just use something like...
my $basename = $ARGV[0] if defined(@ARGV);