There's no good way to access lexical variables outside of their scope. (There are ways to do it, but they involve XS and aren't recommended for production systems.) I've had good luck with Data::Denter, instead.
Comment on Re: Calling variables from external file, with strict