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

what is the main function of fork() in cgi programming?

550


How would you ensure the re-use and maximum readability of your perl code?

522


Write a program to decode the data in the form using cgi programming

550


Explain the different types of data perl can handle.

495


Explain tk?

521






Write a program that shows the distinction between child and parent process?

516


What are the various file operations in perl. Explain with example.

519


How do you turn on the perl warnings?

502


what are prefix dereferencer and list them out?

643


what is the function that is used to identify how many characters are there in a string?

543


What is Perl?

564


What syntax is used for grep() function?

575


What are the various flags/arguments that can be used while executing a perl program?

467


Can inheritance be used in perl? Explain with the help of an example.

513


When would `local $_' in a function ruin your day?

546