print join("\n",&get_sub_list); sub go{} sub test1{} package sublist; sub main::get_sub_list{ no warnings; my ($code,@fn); foreach (keys(%main::)){ next unless /^[\w_]/; push(@fn,$_) if eval("defined(*main::$_"."{CODE})"); } use warnings; @fn }