It's almost certainly to do with running the regex on both the key and the value of the hash. Probably some of the values of a packlist object (returned by ExtUtils::Installed->new->packlist()) are undefined... Is there a function of that packlist that returns what you want, rather than dumping the whole object hash?
in reply to warnings and grep problem
There's no point in doing /match/ && s/match/foo/ that's silly. Instead, try something like defined && s/match/foo/ inside the grep.
But know what you want to run the substitution on first (and other people have suggested this, I know) and do it only on those...