Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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)
vs:
require Whatever; Whatever::report(); # I feel required


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-12-26 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls