http://www.perlmonks.org?node_id=996575


in reply to Debugging child pid 4577 exit signal Segmentation fault (11)

CGI to mod_perl Porting. mod_perl Coding guidelines

If the variable contains a reference it may hold onto lots of unecessary memory (or worse) if the reference is left to hang about until the next call to the same handler. For such variables you should use local so that the value is removed when the handler subroutine exits.

my $query = CGI->new; becomes: local our $query = CGI->new;

Replies are listed 'Best First'.
Re^2: Debugging child pid 4577 exit signal Segmentation fault (11)
by keenlearner (Acolyte) on Oct 01, 2012 at 07:45 UTC
    Hi, when I change the
    our $query = CGI->new;
    to
    local our $query = CGI->new;

    The $query var becomes undefined. the $query is a global variable in a module.

    I wonder why ?