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 are prefix dereferencer?

859


List all the features of perl programming?

857


How do you find the length of an array?

910


How to determine strings length in perl?

911


What exactly is grooving and shortening of the array?

965


How to read a file into a hash array?

999


Explain grooving and shortening of arrays?

1035


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

834


What does init 5 and init 0 do?

958


Differentiate between use and require, my and local, for and foreach and exec and system

852


Explain the use of 'my' keyword in perl?

971


What does the’$_’ symbol mean?

953


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

899


What does this symbol mean '->'?

927


What do you mean by context of a subroutine?

928