The first one does not mesh with your node's title. It says "of the symbols in $pkg, which are defined as functions in this current package?". If you write it as you did in your node title, grep defined ${$pkg . "::$_"}, keys ..., then it would be saying "of the symbols in $pkg, which are defined as functions in $pkg?".
Jeff japhy Pinyan,
P.L., P.M., P.O.D, X.S.:
Perl,
regex,
and perlhacker How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart