in reply to Working With Sub-Par Code

I guess part of your problem is that the $filename is appended to the @file_did_save array regardless of what open returns:
if (open(OUTFILE, ... )) { push(@file_did_save, $filename); } else { push(@did_not_save, $filename . ' ' . $!); }
As pointed out by Anonymous Monk, the line
$config{'image_upload_dir'}.$fntwo
should probably be
$config{'image_upload_dir'} . '/' . $fntwo
or, even better (with File::Spec::Functions)
use File::Spec::Functions; catfile($config{'image_upload_dir'}, $fntwo)
which would make it platform independent (and IMHO) more readable.

I second the perltidy recommendations.

Update: Fixed typo as noted by shmem.

--
Andreas

Replies are listed 'Best First'.
Re^2: Working With Sub-Par Code
by shmem (Chancellor) on Nov 29, 2007 at 12:06 UTC
    should probably be
    $config{'image_upload_dir'}/$fntwo

    Huh? divide, really? I guess you mean

    $config{'image_upload_dir'}."/$fntwo";

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}