Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Determining a module's user

by Fletch (Bishop)
on Oct 10, 2007 at 16:37 UTC ( [id://644024]=note: print w/replies, xml ) Need Help??


in reply to Determining a module's user

caller looks to work sanely inside the Filter::Simple called block (at least with a quick test module).

$ cat FSTest.pm package FSTest; use Filter::Simple; FILTER { print STDERR "in FILTER, caller package: ", (caller( 1 ))[0], "\n"; } 1; $ perl -MFSTest -e 0 in FILTER, caller package: main

Update: Oop. Quick test module FTL then apparently. You may can get at it by calling caller in a custom import sub of your own, of you might have to fall back to using Filter::Util::Call instead. We're past my simple experience with Filter::Simple at any rate.

Replies are listed 'Best First'.
Re^2: Determining a module's user
by clueless newbie (Curate) on Oct 10, 2007 at 17:18 UTC
    For me (Windows/Activestate 5.8) it doesn't. If "main" calls "package" and "package" uses the filtering module, (caller( 1 ))[0] returns not "package" but "main".

    I've found a poor work around that involves "use myFilter __PACKAGE__;".

    Thanks, Fletch!
    --- it seems to be (caller(1))[1]!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://644024]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2024-04-23 18:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found