Crud! This is what I get for typing a program directly into a browser window :)
> for ( 1 .. 5 ) { > if ( my $file = $q->param( "file$_" ) { > my $filename = basename( $file ); > open FILE, "> $user->{'site_id'}/$filename" or error(...); > binmode $file; > print FILE <$file>; > $file_count++; > } > close FILE or die $!; Try switching the "close" and final curly in the above snippet: close FILE or die $!; } If you don't, you'll die the first time you try to close a file that you failed to open since I messed up the scope. Sorry 'bout that! Cheers, Curtis "Ovid" Poe ===== "Ovid" on http://www.perlmonks.org/ Someone asked me how to count to 10 in Perl: push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//; shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]