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 do you mean by context of a subroutine?

1028


How many types of primary data structures in Perl and what do they mean?

1465


Comment on array slicing and range operator

998


Explain what is lvalue?

1073


Comment on data types and variables in perl.

982


How do find the length of an array?

1193


How will you open a file in read-only mode in perl?

961


what is Perl one liner?

951


what is Polymorphism in Perl?

1018


What does localtime() do in perl?

1051


Why to use perl scripting?

1068


How many data types are there in perl?

1013


Is perl compiler or interpreter?

983


What are the functions that can be performed using cgi program?

975


Why -w argument is used with perl programs?

1031