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(); ##################################
In reply to making a library by adieu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |