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:

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...>
In my main file, I can use the constants, as well the AReport object:
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

In reply to Class::Tiny and Exporter at the same time by jaandy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.