in reply to Re: Log4perl, Data::Dumper and varname
in thread Log4perl, Data::Dumper and varname

I looked through both of those posts but wasn't sure how I could use the information to dump the $logger variable with a different name then $VAR1. Sorry if I'm being obtuse but I just couldn't connect the dots...
  • Comment on Re^2: Log4perl, Data::Dumper and varname

Replies are listed 'Best First'.
Re^3: Log4perl, Data::Dumper and varname
by Anonymous Monk on Apr 09, 2010 at 06:59 UTC
    I looked through both of those posts but wasn't sure how I could use the information to dump the $logger variable with a different name then $VAR1.

    There is only about 3 direct replies with actual code. Pick one and test (I'd go for the one which references Data::Dumper the most).

      Here is the solution which seems to work for me:

      $logger->trace( sub { Data::Dumper->Dump($name, 'name') }, undef, $TRACE, undef, undef );