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
What is use of ‘->’ symbol?
Explain gmtime() function in perl?
What's the difference between /^Foo/s and /^Foo/?
I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur
what is Chop & Chomp function does?
What is the use of -t?
What $! In perl?
What is the purpose of “_file_ literal” and “_line_ literal” in perl?
What is perl? What is the basic command to print a string in perl?
How to start perl in interactive mode?
What is it meants by '$_'?
How to access parameters passed to a subroutine in perl?
How does polymorphism work in perl? Give an example.
Enlist the advantages of using c over perl?
Why is it hard to call this function: sub y { "because" } ?