http://www.perlmonks.org?node_id=632301


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