Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Exporting

by cwest (Friar)
on Dec 13, 2000 at 02:37 UTC ( [id://46339]=note: print w/replies, xml ) Need Help??


in reply to Exporting
in thread Module Submission for CPAN

Read the Exporter manpage... here's a simple example:
package Ctweten::Export; use Exporter; our @ISA = qw(Exporter); # we now inherit from Exporter, namely the im +port() method our @EXPORT_OK = qw(this that); # you must ask for these: use Ctweten: +:Export 'this'; our @EXPORT = qw(other); # exporter by default sub this { print "Hello\n" } *that = *other = *this;
In a program, if you want to use this() and other(), you do the following: <code> #!/usr/local/bin/perl -w use strict; $|++; use Ctweten::Export qw(this); other; this; that; # this would die under these circumstances.
--
Casey
   I am a superhero.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-18 08:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found