I have this simple code:
#!/usr/local/bin/perl -w
use CGI;
use Fcntl qw(:DEFAULT :flock);
my $data;
my $hook_called;
my $cgi = CGI->new(\&_hook, $data);
sub _hook
{
my ($filename, $buffer, $bytes_read, $data) = @_;
if (not $hook_called)
{
print $cgi->header();
$hook_called=1;
}
else {
print "Read $bytes_read bytes of filename\n";
}
$hook_called += $bytes_read;
}
and post this simple form to it:
<FORM action="/cgi-bin/test.cgi" method="post" enctype="multipart/form
+-data">
<input value="1154632892005" name="unique" type="hidden">
<INPUT TYPE="FILE" NAME="file">
<INPUT type="submit" value="Send"> <INPUT type="reset">
</FORM>
but, I get NO output.
The hook callback doesn't seem to be getting called at all. What am I doing wrong?