First, it is important that you remember the difference between methods (sort of "subs called on an object or class") and subroutines. For methods, you just need to say

require Sheets; Sheets->make_files;
or invoke some kind of constructor (creating an object) and using a piece of code like this:
require Sheets; Sheets->new->make_files;
There is no need for doing more to have access to a method (no need for exporting, etc.)

If the issue is with subroutines, the following may be valid. If you don't want to change Sheets.pm or is not under your control, the following may do the trick you want:

# load Sheets require Sheets; # making it known to the current package # alias the function that matters *make_files = \&Sheets::make_files; # use it make_files() # call cleanly Sheets::make_files
(and you can discard the alias as well and use directly as Sheets::make_files, which is not that bad if used in a limited scope).

The suggestion of the paragraph above "works" independent of the exporter module used or the idiosyncrasies of the provided import function. Well, works if there is not too much magic behind the panes.


In reply to Re: Using only one subroutine from module file by ferreira
in thread Using only one subroutine from module file by isha

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.