Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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

Comment on Re: Was a module use'd or require'd?
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2015-11-25 18:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (684 votes), past polls