adieu has asked for the wisdom of the Perl Monks concerning the following question:
Steps followed: 1.going to the directory(Documents>>New Folder)which is where my script of Foo1.pm is there. 2. Type h2xs -XA -n Foo1 3. A folder called Foo1 is created. Enter the folder. 4. the directory now is Documents>> New Folder>>Foo1. 5. type perl makefile.pl 6. Type dmake 7. Type dmake install 8. Copy the whole Foo1 folder and Foo1.pm at C:/ Strawberry/Perl/ Lib and C:/ Strawberry/Perl/ Site/Lib. 9. compile the parent code by getting out of foo1 and into documents>> new folder and typing perl test.pl. (Because my test.pl is saved at this directory). but i get following error.: Can't locate object method "bar" via package "Foo1" at test.pl Please help ....where is the prob?????####Code of Library#### package Foo1; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $debug %EXPORT_TAGS); require Exporter; @ISA = qw(Exporter); @EXPORT = qw('bar'); sub bar { print "Hello \n"; } 1; ################################ ################################ ######parent Code ****########## #######test.pl################# use Foo1; Foo1->bar(); ##################################
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: making a library
by NetWallah (Canon) on Mar 08, 2011 at 06:54 UTC | |
by adieu (Initiate) on Mar 08, 2011 at 09:10 UTC | |
by NetWallah (Canon) on Mar 09, 2011 at 04:51 UTC | |
|
Re: making a library
by GrandFather (Saint) on Mar 08, 2011 at 07:24 UTC | |
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 |