Try Data::Dumper::Simple or Data::Dumper::Names which do this.
In reply to Re^3: get name of lexical variable by ambrus in thread get name of lexical variable by khwilliamson