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

Explain the different types of data perl can handle.

489


What happens to objects lost in "unreachable" memory, such as the object returned by Ob->new() in `{ my $ap; $ap = [ Ob->new(), $ap ]; }' ?

538


What is the purpose of “_file_ literal” and “_line_ literal” in perl?

527


How to determine strings length in perl?

525


Explain the arguments for perl interpreter.

519






Explain goto label?

506


how to extract pin_code,phone_number,year from text file using regular expressions in perl

1841


what are the steps involved in reading a cgi script on the server?

487


What is perl pop array function?

528


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

452


Explain tk?

511


What are stdin, stdout and stderr?

505


What is cpan in perl?

542


Explain lists ?

522


Why -w argument is used with perl programs?

548