perl - Access referenced parameters in Carp::longmess() output -
we have multi level evals, passing parameters not reveal if fails, i'm hoping can access of carp::longmess() parameters passed @ higher levels because dump have.
[debug:2564] 2013/10/07 12:54:06 /opt/s3/server/s3comparator.pm:183 - compare() - stacktrace: @ (eval 1312) line 2. s3aihelper::__anon__('s3transiso8583=hash(0x1696eb10)') called @ /opt/s3/server/s3aihelper.pm line 777 s3aihelper::match_fields('s3transiso8583=hash(0x1696eb10)', 'hash(0x168dc750)', '') called @ /opt/s3/server/s3aihelper.pm line 177 s3aihelper::fieldhits('s3transgroup=hash(0x16953d10)', 'hash(0x168dc750)', '') called @ (eval 1081) line 90
it looks after parsing:
my $value = 's3transiso8583=hash(0x1696eb10)';
how become s3transiso8583 object content intact. in same running instance, memory addresses valid.
thanks
in carp
, arguments forcibly stringified. perl, , can work around – monkey patching carp::format_arg
sub.
basically, like:
begin { use data::dump 'dump'; # nicer output data::dumper $orig = \&carp::format_arg; *carp::format_arg = sub { ($arg) = @_ @_ = (dump $arg); goto &$orig; }; }
see this answer of mine explains similar hack in more detail.
Comments
Post a Comment