How can you create an object of a class in a package?

Answer Posted / vipul dalwala

Say Pachage is My Package

package MyPackage;

sub method() {

}


Then U can create Object

$myobject = new MyPackage();

and u can call any method of object like:

$myobject->method();

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When do you use perl programming?

653


What is the difference between single (') and double (") quote in a string in perl?

553


In Perl, there are some arguments that are used frequently. What are that arguments and what do they mean?

599


What is the purpose of _package_ literal?

606


How to close a file in perl?

580






What is subroutine in perl?

602


List the data types that Perl can handle?

645


What are prefix dereferencer? List them.

651


How and what are closures implemented in perl?

562


What is the use of -t?

644


Mention the difference between die and exit in Perl?

751


What are the advantages of perl programming?

625


How do I sort a hash by the hash key?

655


What are the options that can be used to avoid logic errors in perl?

597


Show the use of sockets for the server and client side of a conversation?

552