package Test; $testing = 'TEST'; @test_array = (qw/OneTest TwoTest/); %test_hash = ('testkey' => 'testvalue'); foreach $symname (sort keys %Test::) { local *sym = $Test::{$symname}; print "\$$symname is defined\n" if defined $sym; print "\@$symname is nonnull\n" if @sym; print "\%$symname is nonnull\n" if %sym; }