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

There are 5 red shoes, 4 green shoes. If one draws randomly a shoe what is the probability of getting red shoe is ?

1173


What is the smallest number by which 2880 must be divided in order to make it into a perfect square ?

1297


dear sir I need ordance factories non technical model question paper so pls send me the model paper my E-mail Id is sakthisaa@gmail.com

2186


Pankaj walks east and turns right and then from there to his left and then 45degrees to his right. In which direction did Pankaj go?

1220


What is degree of a Relation?

1232


Grass in lawn grows equally thick and in a uniform rate. It takes 24 days for 70 cows and 60 for 30 cows . How many cows can eat away the same in 96 days.?

1193


the probability of getting at least in a single through of three coins is

1190


A monkey starts climbing up a tree 20ft. tall. Each hour, it hops 3ft. and slips back 2ft. How much time would it take the monkey to reach the top?

1453


The various degrees of the vertices are marked in the dig. Find y?

1235


If D is adjacent to F then who is adjacent to C?

1929


Why RSD of area limit is 15?

2457


In a arithmetic reason 10,9,60,90,70 and 66.. .whats the next number with conclusion

2056


Which one of the following is correct a) $$Z(4).99 b) $9(4)zz.99 c) A(4)BB d) +9(5).99CR

2739


where is genarak driving aptitude

2169


A speedboat whose speed is 15 kmph in still water goes 30 kmph downstream and comes back in a total of 4hrs 30min. What is the speed of the stream in kmph?

1220