jaandy has asked for the wisdom of the Perl Monks concerning the following question:
Wise Monks, I find I have written code that works fine, at least it seems. But I cannot understand _why_ it works. It seems like it should not, there for I'm seeking understanding
I am generating a report, using PDF::API2. I've created myself a little helper object:
In my main file, I can use the constants, as well the AReport object:package AReport; use common::sense; use PDF::API2; use Exporter qw( import ); use constant mm => 25.4 / 72; use constant in => 1 / 72; use constant pt => 1; our @EXPORT = qw(mm in pt); use Class::Tiny qw(api x y pageW pageH bodyW bodyH); <etc...>
use AReport; my $pdf = AReport->new( file => 'junk.pdf', pageW => 8.5/in );
It all seems to work, but there should be two import() procedures, one for Class:Tiny and one for Exporter. Only one should get called, but seems as both do? How?
Thank you for your time,
-Andy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Class::Tiny and Exporter at the same time
by haukex (Archbishop) on Nov 13, 2016 at 17:47 UTC | |
|
Re: Class::Tiny and Exporter at the same time
by choroba (Cardinal) on Nov 13, 2016 at 17:51 UTC | |
by jaandy (Acolyte) on Nov 13, 2016 at 18:00 UTC |