in reply to Creating file at run time

Change the prefix to the filename:
open (OUT, ">$inputfile.out") or die "cannot open file: $!\n";
This will open the file for output, creating it if it does not already exist. '+' gives you read and write access to a file, but it will only be created if you open the file for output or appending.