datannen has asked for the wisdom of the Perl Monks concerning the following question:
and post this simple form to it:#!/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; }
but, I get NO output. The hook callback doesn't seem to be getting called at all. What am I doing wrong?<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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI hook
by rhesa (Vicar) on Aug 08, 2006 at 02:05 UTC | |
|
Re: CGI hook
by ikegami (Patriarch) on Aug 08, 2006 at 00:27 UTC | |
|
Re: CGI hook
by Zaxo (Archbishop) on Aug 08, 2006 at 01:41 UTC | |
by ikegami (Patriarch) on Aug 08, 2006 at 02:39 UTC | |
by Zaxo (Archbishop) on Aug 08, 2006 at 03:23 UTC | |
by cees (Curate) on Aug 08, 2006 at 04:27 UTC | |
by rhesa (Vicar) on Aug 08, 2006 at 03:36 UTC | |
by imp (Priest) on Aug 08, 2006 at 03:47 UTC | |
by datannen (Novice) on Aug 08, 2006 at 02:02 UTC | |
by Anonymous Monk on Aug 08, 2006 at 03:27 UTC |