Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Undefined subroutine

by Wonko the sane (Deacon)
on Mar 11, 2003 at 14:33 UTC ( [id://242044]=note: print w/replies, xml ) Need Help??


in reply to Undefined subroutine

Corrected and tested version of your code.
############################################## package J9Test; use strict; use warnings; use vars qw(@ISA @EXPORT); use Exporter; @ISA = qw(Exporter); @EXPORT = qw( Prt Time ); sub Prt { my $string = shift; print &Time() . "- $string\n"; } sub Time { my @localdate = localtime(time); my $tme = sprintf("%02d:%02d:%02d", $localdate[2], $localdate[1], +$localdate[0]); return($tme); } 1; ############################################## ############################################## #!/usr/bin/perl use strict; use warnings; use lib q{.}; use J9Test; print "About to use Module\n"; Prt("This is a test in the Mod"); print "Finished\n"; ##############################################

Damian Conway's Object Oriented Perl has one of the better explanations of how all this works.
I always highly recomend that book.

Wonko

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-23 16:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found