in reply to Re: Using the perl debugger to look at a renaming files function
in thread Using the perl debugger to look at a renaming files function

> If this is a redefinition, then look for another module which exports a function with the same name.

Perl keeps the information where (file, line and package) a function was declared before exporting.

There multiple ways to introspect° it, I chose Devel::Peek out of laziness.

Introducing the line 123 in the code just before the redefinition happens will show the culprit.

DB<121> use Cwd DB<122> use Devel::Peek DB<123> Dump \&getcwd if defined &getcwd SV = IV(0x3458550) at 0x3458560 REFCNT = 1 FLAGS = (TEMP,ROK) RV = 0xdc79e0 SV = PVCV(0xe02188) at 0xdc79e0 REFCNT = 11 FLAGS = (DYNFILE,HASEVAL) COMP_STASH = 0xd54290 "Cwd" # PACKAGE START = 0x2985788 ===> 1 ROOT = 0x29ade90 GVGV::GV = 0xdc7b48 "Cwd" :: "_win32_cwd" # NAME FILE = "c:/Perl_524/lib/Cwd.pm" # FILE DEPTH = 0 FLAGS = 0x5000 OUTSIDE_SEQ = 633 PADLIST = 0x29d5aa8 PADNAME = 0x29bb378(0x29ca0a8) PAD = 0xdc79f8(0x29c8968) 1. 0xdc7a28<1> (634,635) "$pwd" OUTSIDE = 0xd540e0 (UNIQUE) DB<124>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

°) the B backend has methods for it, some modules offer wrapper for it:

  • Comment on Re^2: Using the perl debugger to look at a renaming files function (introspection)
  • Download Code