Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Undefined subroutine

by blokhead (Monsignor)
on Mar 11, 2003 at 14:20 UTC ( [id://242035]=note: print w/replies, xml ) Need Help??


in reply to Undefined subroutine

A few things wrong: you don't want these to be lexical (my) variables!

my @ISA    = qw(Exporter);
my @EXPORT = qw(Prt Time);

They are not available to Exporter as lexicals, they need to be global symbol-table vars (thus the use vars).

Heh, but the real reason Test::Prt still won't work is because Test is a very, very bad name for your first module. There is already a Test module in your Perl distribution, and your script is most likely loading that instead. A use lib '.' line in the script will tell Perl to look in the current directory to load modules first. Either do that, or change the name of your module's namespace.

blokhead

Replies are listed 'Best First'.
Re: Re: Undefined subroutine
by J9 (Beadle) on Mar 11, 2003 at 14:33 UTC
    Hehe.. <REDFACE MODE ON>

    I have fixed the lexical variable this, that is after all why I used the use vars declaration.

    I have also renamed my module to J9Test.pm now I KNOW there isn't another module there with that name..(I checked)

    <REDFACE MODE OFF>

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://242035]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-25 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found