Re: how to use perl modules
- From: jabirahmed@xxxxxxxxx (Jabir Ahmed)
- Date: Tue, 27 Sep 2005 23:05:23 -0700 (PDT)
-----------------------------------------------
test.pm
-----------------------------------------------
package test;
sub ReturnValue()
{
my $a=10;
return ($a);
}
1; # as a module usually has a return value
-----------------------------------------------
call.pl
-----------------------------------------------
use test;
print test::ReturnValue(); # specify the package name
where the function resides
#or u could try this also
$tmp=test;
print $tmp->ReturnValue();
#-----
jabir
--- Abhishek Dave <adave@xxxxxxxxxxx> wrote:
> hello all,
> i've wrote a small test subroutine in my file name
> test.pm and in the same directory i worte
> a perl file in which i've to call this subroutine in
> this perl program
>
> I dont know how to use perl modules
> pls let me knwo abt that as it will solve my lots of
> problems
>
> test.pm
>
> sub ReturnValue()
> {
> my $a=10;
> return ($a);
> }
>
> call.pl
>
> use test;
> print ReturnValue();
>
>
> --I don't know abt the moduls in perl
>
> Pls help me in this regard asap
>
> waiting for reply from perl group
>
> Thanks
> Beginner
I do the diffcult immediately,but the impossible take's a little longer!!!
Cresent canaopy apartments
#19 Davis Road,
Thomas town,
Bangalore -84
Phone (mobile) : +91-98867 01148
E-Mail: jabirahmed@xxxxxxxxx,jabirahmed@xxxxxxxxx
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
.
- References:
- how to use perl modules
- From: Abhishek Dave
- how to use perl modules
- Prev by Date: how to make charts using GD
- Next by Date: RE: how to make charts using GD
- Previous by thread: Re: how to use perl modules
- Next by thread: Shift Question
- Index(es):
Relevant Pages
|