# set variable, check items in PKG symbol table $ perl -Mstrict -e '$PKG::foo=1; print keys %PKG::' foo $ perl -Mstrict -e '$foo=1; print keys %main::' Global symbol "$foo" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors. $ perl -Mstrict -e 'our $foo=1; print grep {/foo/} keys %main::' foo