# option 1 print "Enter the name for the output file:\n"; my $outfile = ; chomp $outfile; #parens not needed # option 2 my $outfile = 'output.txt'; # option 3a my $outfile = $firstfilename.'.out'; # option 3b - using $0 aka the current program filename use File::Basename qw(basename); my $outfile = (basename $0).'.out';