what is the procedure to define a user define module in your
perl application?
Answers were Sorted based on User's Feedback
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 |
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 |
Explain grooving and shortening of arrays and splicing of arrays?
We all know private variables exist in perl. But do private METHODS exist in perl ? Eg ?
How will you access an element of a perl array?
How can you create an object of a class in a package?
while(my($key, $value) = each(%hash) ) { print "$key => $value\n"; } my($key, $value); while(($key, $value) = each(%hash) ) { print "$key => $value\n"; } What is the different between these two code in case of "my" usage ?
how to get back up from private character editor which is saved in the format of .udf
Write a script to reverse a string without using perl's built in functions?
How can you define “my” variables scope in Perl and how it is different from “local” variable scope?
How many data types are there in perl?
How to start perl in interactive mode?
What is the difference between localtime() and gmtime() functions?
What is qq (double q)operator in perl?