Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the use of -w, -t and strict in Perl?

1050


Explain lists ?

982


Why does Perl not have overloaded functions?

1103


What does -> symbol indicates in Perl?

1039


What are the steps involved when the cgi program starts running?

965


What is the difference between die and exit in perl?

1055


What does Perl do if you try to exploit the execve(2) race involving setuid scripts?

996


What does the qx{ } operator do?

973


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

988


How can you call a subroutine and identify a subroutine?

1036


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

1109


What package you use to create a windows services?

931


Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?

1039


What is perl pop array function?

1001


what is Chop & Chomp function does?

1040