Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the procedure to define a user define module in your
perl application?

Answer Posted / nachikethas

Create a .pm file eg xyz.pm and you can have subroutines or
what ever you want can be placed there.

#content of xyz.pm
package xyz;
sub Printit{
print "In module xyz...";
}
1;
#end of xyz.pm

for using this perl module in ur perl program eg abc.pl

# content of abc.pl

use xyz;
xyz->Printit();

#end pf abc.pl

hope this helps :)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is use of ‘->’ symbol?

959


Explain gmtime() function in perl?

927


What's the difference between /^Foo/s and /^Foo/?

1118


I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur

2005


what is Chop & Chomp function does?

954


What is the use of -t?

919


What $! In perl?

919


What is the purpose of “_file_ literal” and “_line_ literal” in perl?

880


What is perl? What is the basic command to print a string in perl?

838


How to start perl in interactive mode?

995


What is it meants by '$_'?

869


How to access parameters passed to a subroutine in perl?

920


How does polymorphism work in perl? Give an example.

827


Enlist the advantages of using c over perl?

878


Why is it hard to call this function: sub y { "because" } ?

891