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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

i need icet solved papers 2000 to 20010,and also mock papers,mock online

2377


cgl2010 tier 2 ki merit kya rhgi

2317


The house is big and lovely but since nobody uses it it is pretty much a white Elephant What does White Elephant mean?

1444


Find the value of the 678 to the base 7.

1202


A person spending out 1/3 for cloths , 1/5 of the remaining for food and 1/4 of the remaining for travellers is left with Rs 100/- . How he had in the beginning ?

1275


A person was fined for exceeding the speed limit by 10 mph. Another person was also fined for exceeding same speed limit by twice the same. If the second person was travelling at a speed of 35 mph, find the speed

1322


Four persons can cross a bridge in 3, 7, 13, 17 minutes. Only two can cross at a time. Find the minimum time taken by the four to cross the bridge.

1346


A Fraction has the denominator greater than its numerator by 4. But if you add 10 to the denominator, the value of the fraction would then become 1/8. What is the fraction. 1/5,3/7,1/3,2/6

1228


if a man byes 1 lt of milk for 12 rs and mixes with 20% of water and sels it for rs 15 thgen what is percentage of gain

1313


How many mashes are there in a sq. m of wire gauge. Each mesh being 8mm long X 5mm width

1203


A, B, C, D, E, F, G, H, I are all of squares which are combined in a square. Area of B is 81 cm2. Side of A is 1 cm. Then find area of I?

1186


There are 3 societies a,b,c. a lent tractors to b and c as many as they had. After some time b gave as many tractors to a and c as many as they have. After sometime c did the same thing. At the end of this transaction each one of them had 24. Find the tractors each originally had.

1238


chief : tribe :: governor :

1230


If m/n = 5/4 , then 2m+n= ?

1203


in a mixture, R is 2 parts, S is 1 part. in order to make S to 25% of the mixture, howmuch R is to be added

1182