use strict; use CGI; our $test = "Big test"; go(); sub go { my $q = CGI->new(\&hook); print $test; } sub hook { my ($filename, $buffer, $bytes_read, $data) = @_; print $test; }