How can you create an object of a class in a package?
Answer Posted / shah faisal
package Test;
sub new
{
$class = shift;
$self = {};
bless $ref,$class;
return $ref;
}
1;
# In perl Script
use Test; # Include the module you have created
$obj=new Test; # creating an onject of Class Test
Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
Explain socket programming in perl?
Explain about the applications of perl?
Comment on array slicing and range operator
Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)
Explain the various characteristics of perl.
How to convert arrays into a string in perl?
What are the various perl data types based on the context?
Explain goto name?
How do I debug a perl program?
What is the importance of perl warnings?
Which functions in Perl allows you to include a module file or a module and what is the difference between them?
Explain different types of perl operators.
Define perl scripting?
Can we load binary extension dynamically?
How to disable the mod_perl from apache_server as i have used perlfect search on the site and its pagination is not working and the remedy is to disable the mod_perl.