I see a number of problems.

1) FIRST: A Perl module should be set up like a Perl executable module. So that you can have a test() target that does a "sanity check" for debugging, etc. That means that that this module should start like any other Perl module. You are Windows user, but this is the standard preamble that will allow your programs to work on Unix. This is completely compatible with Windows and even the -w option on the first line is recognized as "use warnings" although the script path is ignored.

#!/usr/bin/perl -w use strict;
2. Use of BEGIN {} is not needed here.

3. use of address of sub_name is not needed: &load_config, just load_config is better.

4. use of @EXPORT (%args) makes no sense. You have no %args to export, but this would not be an error.

There are vars that are exported by default and some that can be exported upon "request" by caller. All subroutine names are "eligible for export". A scalar can only be exported if it has "our" declaration (package scope) - you don't have any so this is not an issue here.

I think you will have much better luck with this preamble:

#!/usr/bin/perl -w use strict; package Routines; #File is Routines.pm IMPORTANT! use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION); use Exporter; our $VERSION=1.0; our @ISA = qw(Exporter); our @EXPORT = qw( clear_config load_config show_config command_showconfig ); our @EXPORT_OK = qw();
Calling program does a
use Routines;

I did not do any testing of you code so I don't know if it works or not.


In reply to Re: cannot export from Module by Marshall
in thread cannot export from Module by sqspat

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.