On Sun, Jun 01, 2003 at 10:47:59AM -0500, Nathan Byrd wrote: > Alternatively, as a possibly better approach could we force a symbol > entry for each package so a module author could check for that? For > instance, if the DBI package was found and loaded from a PAR archive, it > would create a scalar in the DBI symbol table something like $DBI::PAR = > "/path/to/par/file.par";.
Independent of the arguments about whether this is viable, I think that it would be bad to stomp over innocent packages' namespaces. Instead, how about a hash in PAR's namespace keyed by package name. Er, file name. There's the problem. More than one package can be in a file, and a package can be declared across more than one file. Can you get the information you need via caller()? You will need to cheat and do this by calling another function inside your package, as you can't use caller to get your own file name, only your caller's file name. Nicholas Clark
