Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Was a module use'd or require'd?

by TheDamian (Priest)
on Aug 13, 2007 at 20:18 UTC ( #632301=note: print w/replies, xml ) Need Help??

in reply to Was a module use'd or require'd?

Does this achieve what you were hoping for?
package Whatever; use Filter::Simple; my $was_used; my @use_args; FILTER { $was_used = 1; @use_args = @_; }; sub report { warn $was_used ? "I feel used (with: @use_args)\n" : "I feel required\n" ; } 1;
and then:
use Whatever qw<this that tother>; Whatever::report(); # I feel used (with: this that tother)
require Whatever; Whatever::report(); # I feel required

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://632301]
LanX having only a fake profile is hard if a flirt asks to befriend you
[erix]: "surveillance companies" have been rebranded as "social media"
[LanX]: I'm using whatapp though :-/
[LanX]: Snowden remins me of Evan Spiegel (... start of a new conspiracy theory)
[LanX]: yes! The same person!
[Eily]: LanX can't be, they're both on the picture at the same time. Duh
[LanX]: They hired a Hollywood producer to fake the pic

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2018-03-19 15:30 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.