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
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
How to renaming a file in perl programming?
What are the steps involved in configuring a server using cgi programming?
When do you use perl programming?
Explain the meaning of perl one-liner?
What is Perl?
you are required to replace a char in a string and store the number of replacements. How would you do that?
Explain the difference between declarations of 'my' and 'local' variable scope in perl?
Explain USE and REQUIREMENT statements?
What is the purpose of goto expr statement?
Explain lists ?
What are the advantages and disadvantages of perl language?
Comment on the scope of variables in perl.
You want to download the contents of a url with perl. How would you do that?
How will you open a file in a write-only mode in perl?