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

Re: Simple Module Tutorial

by sg (Pilgrim)
on Feb 05, 2011 at 23:13 UTC ( #886453=note: print w/replies, xml ) Need Help??

in reply to Simple Module Tutorial

Thanks for the exposition; my inclination regarding a simple module is as follows:
package MyModule; use strict; use warnings; use diagnostics; use Carp; our $VERSION = 1.08; sub see_me { my $foo = shift; print "\t\tDo you see this: $foo?\n"; } 1; __END__ last line of the module needs to be true; last line of the _file_ need not be true: 0;

The above module is exercised by the following script:

#!/c/opt/perl/bin/perl use strict; use warnings; use diagnostics; use Carp; use MyModule 1.05; #use MyModule 1.10; # will fail MyModule::see_me( 8 ); __END__

Replies are listed 'Best First'.
Re^2: Simple Module Tutorial
by chanslor (Acolyte) on Feb 27, 2015 at 19:47 UTC
    Thank you for this post! It has gotten me past the first barrier of writing my own module. Thanks again! - chanslor

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://886453]
[erix]: I do some work as a corrector (if that's the right word) and often I have to remove phrases that people think is dutch but that is really literally taken from english (and does not exist in dutch. Although at some point it becomes acceptable, of course)
[erix]: "Do not be dafter than you are" doesn't seem a very good translation
LanX understands corrector but thinks it's editor
[LanX]: don't feign ignorance

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2018-03-19 22:24 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (246 votes). Check out past polls.