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 does -> symbol indicates in Perl?

559


Write syntax to use grep function?

550


Differentiate use and require?

519


How will you create a file in perl?

521


What is the different between array and hash in perl programming?

513






What is the use of "stderr()"?

569


What does localtime() do in perl?

561


What are some of the key features of objects in perl?

515


What are different data types that perl supports. Elaborate on them.

548


What do you mean by context of a subroutine?

560


How to read a file into a hash array?

548


What does cgi program store?

535


Which has highest precedence in between list and terms? Explain?

438


What are the advantages of perl programming?

532


You want to connect to sql server through perl. How would you do that?

540