Hi Monks,
I am creating one module and using exporter module. Whole idea is not to export all methods that I have wriiten inside the module.
Want only some of the methods to export in calling programs. To achieve this I am doing like this:
BEGIN { use Exporter (); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); #set the version for version checking; uncomment to use $VERSION = 1.00; @ISA = qw(Exporter); @EXPORT = qw( &getTableDDL &getIndex &getMatchingTableDDL + &getConstraints); %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], # your exported package globals go here, # as well as any optionally exported functions @EXPORT_OK = qw(); $Exporter::Verbose=1 }
When I run the calling program it says like this :
Importing into P3::feed from P3::lib::Dbschema: &getTableDDL &getIndex &getMatchingTableDDL &getConstraints
does this mean that it only exports above methods, not all methods.
Is there any way to test that other subroutines has not been exported.
I removed all methods name from export array then I ran the program,
it says the Importing into P3::lib::Dbschema: does this mean it imports all methods from module ?
Thanks in advance for your valuable advice.
Additon:
i am using this in calling program like this:
my $dbh = $entity->getConnection(); # Grab a connection for general us +e my $obj = Dbschema->new($dbh); my ($val) = $obj->getMatchingTableDDLDbaPortal','Entity%'); ###this method getMatchingTableDDL is get called even if removed from +exporter array in module !!!

In reply to Using Exporter module by perlCrazy

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.