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

Why we use CGI?

2530


What are the benefits of perl in using it as a web-based application?

895


Why does Perl not have overloaded functions?

1031


What are scalars?

985


What is use of ‘->’ symbol?

1004


How to concatenate strings in perl?

1033


How to read from a pipeline with Perl

1036


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

928


How will you declare a variable in perl?

962


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

908


What are different data types that perl supports. Elaborate on them.

1069


Explain string comparison operators in perl.

1006


How can arrays be tied?

911


Does Perl have reference type?

923


What are the two ways to get private values inside a subroutine?

891