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...


Types of attribute and then describe it.



Types of attribute and then describe it...

Answer / mahesh

use Attribute::Types;

my $count : INTEGER; # Can only store an integer
my $date : INTEGER(1..31); # Can only store an int
between 1..31
my $value : NUMBER; # Can only store a number
my $score : NUMBER(0.1..9.9); # Can only store a num
between 0.1..9.9
my @rain : NUMBER; # Elements can only
store numbers
my %vars : SCALAR; # Entries can only
store scalar refs
my %handler : CODE; # Entries can only
store sub refs
my $arr : ARRAY; # Can only store array ref
my @hashes : HASH; # Elements can only
store hash refs
my $glob : GLOB; # Can only store a
typeglob ref
my $pattern : REGEX; # Can only store a qr'd
regex
my $ref2 : REF; # Can only store a
meta-reference

my $obj : Type(My::Class); # Can only store
objects of (or
# derived from) the
specified class

my $x : Type(/good|bad|ugly/); # Can only store
strings matching
# the specified regex

sub odd { no warnings; $_[0]%2 }

my $guarded : Type(&odd); # Can only store values
for which
# odd($value) returns true

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More General Aptitude Interview Questions

what is the next number in the series 3,26,15,124,

7 Answers   HCL, IBM, NEC,


The cycle has following specifications: The rear derailer is on the 14 tooth gear and the front derailer is on the 52 tooth gear. The rear gear has 14 teeth. The diameter of the rear wheel is 27". If a cyclist pedals at 75 revolutions per minute, then what will be the speed achieved?

0 Answers   Cap Gemini,


A car is filled with 4.5 gallons of fuel for a round trip . Car is taken 1/4 more than in going than coming up. What is the fuel consumed in coming up ?

9 Answers   Accenture, TCS,


The passage implies that a moral principle derived from applying Murphy's philosophy to a particular group would be applicable to another group if

0 Answers   Satyam,


1) 1)difference between ip and non ip protocol.

0 Answers   RRB,


CROSS+ROADS=DANGER.what is the value of D+A+N+G+E+R ?

5 Answers   Infosys,


The average salary of Ram, Shyam and Sundar is 95 Rs. per week. If Ram earns Rs.115 and Shyam earns Rs.65.What is the salary of Sundar.

0 Answers   Cap Gemini,


In a queue, a man is standing at the position 10th from the front and 15th from behind. How many persons are standing in the queue?

0 Answers   CGI,


Find sum of 3 + 5/(1+22) + 7/(1 + 22 + 32) + ......

0 Answers   Flipkart, Wipro,


(165)2 - (164)2 =

6 Answers  


who is frist chief commissioner of income tax in india

0 Answers  


By selling 1 dozen ball pens, a shopkeeper earned the profit equal the profit equal to the selling price of 4 ball pens. His profit percent is? a)50 b)40 c)33 1/3 d)31 1/4 plz specify reason... thanks

3 Answers  


Categories