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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / subina

Package Module_name;
require Exporter;
@ISA = qw(list of base classes);
@Export = qw(list of symbols );

#------------code---------------------



#at the end of module

1;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

What is stdin in perl?

0 Answers  


Difference between Perl and Mod_perl?

2 Answers  


Where the command line arguments are stored and if you want to read command-line arguments with Perl, how would you do that?

0 Answers  


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

0 Answers  


“Perl regular expressions match the longest string possible”. What is the name of this match?

0 Answers  






How to concatenate strings with perl?

0 Answers  


What is the syntax used in Perl grep function?

0 Answers  


What is “grep” function in perl?

0 Answers  


What are the different instances used in cgi overhead?

0 Answers  


If EXPR is an arbitrary expression, what is the difference between $Foo::{EXPR} and *{"Foo::".EXPR}?

0 Answers  


Which guidelines by Perl modules must be followed?

0 Answers  


There are some duplicate entries in an array and you want to remove them. How would you do that?

0 Answers  


Categories