in reply to making a library
Actually if you are taking small steps toward an OO module then you have too much stuff in your module. You can trim it to just:
use strict; use warnings; package Foo; sub bar { print "Hello \n"; } 1;
With the driver script you showed and Foo.pm in the same directory that will print "Hello" as expected. That's it. Nothing more is required. If you copy Foo.pm to your Perl's site/lib folder it will still work and now you can use Foo.pm from anywhere.
Unless you are preparing a module for CPAN, there need be nothing more to making your library available than that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: making a library
by adieu (Initiate) on Mar 08, 2011 at 09:07 UTC | |
by GrandFather (Saint) on Mar 08, 2011 at 09:45 UTC | |
by tospo (Hermit) on Mar 08, 2011 at 09:27 UTC | |
by adieu (Initiate) on Mar 08, 2011 at 09:33 UTC | |
by adieu (Initiate) on Mar 08, 2011 at 09:35 UTC | |
by tospo (Hermit) on Mar 08, 2011 at 15:53 UTC |