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 hash?

0 Answers  


What happens in dereferencing?

0 Answers  


What purpose does each of the following serve: -w, strict, - T ?

2 Answers  


What is the difference between having a parenthesis after module name and without parenthsis after module name?? i.e Package::Module(); and Package::Module;

1 Answers  


How to open and read data files with Perl

0 Answers  


Differentiate between use and require, my and local, for and foreach and exec and system

0 Answers  


How will you declare a variable in perl?

0 Answers  


How to convert strings into an array in perl?

0 Answers  


Explain 'grep' function.

0 Answers  


Write a simple regular expression to match an IP address, e-mail address, city-state-zipcode combination.

15 Answers  


How to sort arrays in perl?

0 Answers  


How to print escaping characters inside a string in perl?

0 Answers  


Categories