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