note
TheDamian
Does this achieve what you were hoping for?
<code>
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;
</code>
and then:
<code>
use Whatever qw<this that tother>;
Whatever::report(); # I feel used (with: this that tother)
</code>
vs:
<code>
require Whatever;
Whatever::report(); # I feel required
</code>
632158
632158