menth0l has asked for the wisdom of the Perl Monks concerning the following question:
Output:sub get_caller() { print caller() . "\n"; } sub dummy() { my $dummy_module = " package DUMMY; sub wrapper {main::get_caller()}; 1; "; eval $dummy_module; my $dummy = {}; bless $dummy, 'DUMMY'; $dummy->wrapper(); } get_caller(); dummy();
Is it possible to 'disguise' caller module in easier, more elegant way? I need it to log messages in log4perl as if they were logged from totally different module...main DUMMY
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to "disguise" caller
by moritz (Cardinal) on Feb 10, 2011 at 14:17 UTC | |
by menth0l (Monk) on Feb 10, 2011 at 14:58 UTC | |
by moritz (Cardinal) on Feb 10, 2011 at 16:17 UTC | |
by Voronich (Hermit) on Feb 10, 2011 at 14:45 UTC | |
|
Re: How to "disguise" caller
by belden (Friar) on Feb 10, 2011 at 15:50 UTC | |
|
Re: How to "disguise" caller
by DrHyde (Prior) on Feb 11, 2011 at 11:02 UTC |