I am trying to write a Perl module that exports a group of names and I can't seem to get it to work. It must be something obvious that I am not seeing.

This is my module in the file "tmod.pm" in the current directory:

package tmod; use 5.20.0; use strict; use warnings; require Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw($v0 $v1 $v2); our %EXPORT_TAGS = (tag_v0=>[qw($v0)]); our $v0=0; our $v1=1; our $v2=''; 1;

And this is my test script:

use 5.20.0; use strict; use warnings; use Carp; use tmod qw(tag_v0); say "done"; exit;

The result is:

perl test_tmod.pl "tag_v0" is not exported by the tmod module Can't continue after import errors at test_tmod.pl line 5. BEGIN failed--compilation aborted at test_tmod.pl line 5.

I am running Citrus Perl 5.24.01 under Windows 10

All help will very much appreciated.

David


In reply to EXPORT_TAGS does not export a defined tag by perlpipe

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.