in reply to Help debuging a script that uses commands I am just learning

Eagle f91 having committed the web forum blunder of asking for an opinion, and I having a quiet morning without the missus, I hereby offer my less than oh-so-humble two-cents.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

I know that's the way some documents say you should link to your name-space but I've seen it break websites. Think what happens if w3.org is not available. Do you really need to specify a name-space? I don't see anything in your html that could be rendered in a non-standard way.

open (FILE, 'e:\web\public_html\finalfantasyinfo\ffinfo\ssi\header.txt +') or die +'Can not open e:\web\public_html\finalfantasyinfo\ffinfo\ssi/header.t +xt'; print <FILE>; close FILE;

More a style preference but I would open all the files first then print your html. That way if one of the files won't open you can abort the screen and give them a less confusing error. It would also make the perl code cleaner. If you are worried about too many open filehandles then use symbolic filehandles. You're not saving any memory as print <FILE> slurps the whole thing in before printing it so you might as well slurp the files into scalars then call print on the scalars. There is also not reason not to be paranoid and open those for reading only: open (my $file, '<e:\blahblahblah\header.txt')That little change could prevent a mis-type from clobbering your dataset.

This seems awkward: mkdir ("e:/web/public_html/finalfantasyinfo/ffinfo/protected/images/avatars/$Game"); I wouldn't expect a cgi script to have permissions to create directories and you would only need to create the directory once but here each invocation of the script tries to create the directory and without checking first if the directory already exists.

Multiple param() statements could become this:

( $Creator, $ContactMethod, $Contact, $FileName, $Game , $Section, $Width, $Height, $File, ) = map { param } qw( Creator ContactMethod Contact FileName Game Section Width Height File )
Although I'm not sure this could be considered a visual improvement. It's just that programmers are lazy and always look for an automated way to excise any repetition.

Happy coding! Looks like you have a fun little project there Eagle f91.


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}