in reply to Moving a .html file

oko1 has suggested the most likely reason your script is failing, however you'd get to that answer a lot quicker if you added some basic sanity checking to your script. For example your open would be better as:

open my $fout, '>', $dynamic or die "Failed to open >$dynamic<: $!\n";

Note the use of a lexical file handle, three parameter open, reporting of failure of the open (using the "or die" - that's the most important part) and a simple create ('>') instead of the original append which probably doesn't do what you want according to your description.

Actually there is a lot in that code that could be improved. Consider:

#!/usr/bin/perl use strict; use warnings; use CGI; my $buffer; read STDIN, $buffer, $ENV{'CONTENT_LENGTH'}; my ($firstChoice, $secondChoice) = split /&/, $buffer; s/[^=]*=// for $firstChoice, $secondChoice; my $fileName = "$firstChoice$secondChoice.html"; open my $fOut, '>', $fileName or die "Failed to open >$fileName<: $!\n +"; print $fOut <<HTML; <html> <head> <title>$firstChoice and $secondChoice</title> </head> <body> You chose $firstChoice and $secondChoice </body> </html> HTML close $fOut; print "Location: dynamics/$fileName\n\n";

Oh, in case it's not obvious I've not tested this code. ;)

True laziness is hard work