Hello Perl Monks,
I am facing a problem with the perl modules and dont know how to go about it, i request you for yur assistance.
i have a sample perl module called hello.pm and here is the script below.
#!/usr/bin/perl
package Hello;
use Exporter;
@ISA = ('Exporter');
@EXPORT = ('hello');
sub hello {
print "Hello, world\n";
}
1;
hello.pl is the script which makes use of Hello.pm
#!/usr/bin/perl
use Hello;
hello();
I was running these on C:\ and it was working fine, the moment i moved these two into another folder Ex: c:\test
\testbvt and tried running them it gave me an error as below.
C:\GSDBVTAS\GSDBVTMAIN>perl hello.pl
Can't locate Hello.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site
+/lib .) at
hello.pl line 3.
BEGIN failed--compilation aborted at hello.pl line 3.
Could you please guide me as to how to go about implementing it. Looking forward for your assistance.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.