in reply to adding a variable definition to execution

$basename = shift should work for your needs. (execute with ./file.pl filename)