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 40 seats in a bus. People agree to share the money for the number of seats. The total money comes to 70.37. How many seats were free?

1903


In simple interest what sum amounts of Rs.1120/- in 4 years and Rs.1200/- in 5 years.

1524


9 cards are there. you have to arrange them in a 3*3 matrix. cards are of 4 colours.they are red,yellow,blue,green. conditions for arrangement: one red card must be in first row or second row.2 green cards should be in 3rd column.Yellow cards must be in the 3 corners only. Two blue cards must be in the 2nd row. At least one green card in each row.

1192


If "PROMPT" is coded as QSPLOS ,then "PLAYER" should be?

2456


In a classroom, a student is ranked 12th from right and 9th from left. How many students are there in total?

1202


How many 3-digit numbers with atleast one 5 in their digits?

1416


Find the least value of 3x + 4y if x2y3 = 6.

1446


I had Rs.100 and I play. If I win I will have Rs110 and if I lose I will have Rs. 90. at the end I have 2 wins and 2 lose. How much do I have?

1485


what is the largest prime number in 8 digit number?

1223


5 women given some of their heights(tall,medium,short)Hair( long, plainted),stards(Black or Brown), sari,2 medium,2-short.Tall-no sari.Plainted-medium.Answer the combinations.

1490


6 people A,B,C,D,E and F sit around a table for dinner. Since A does not like C, he doesn't sit either opposite or beside C.B and F always like to sit opposite each other. If A is beside F then who is are the two neighbours of B?

2261


aptitude questions

8506


A&B fill 3 litres and 5 litres of oil in the car. C pays Rs. 8/- to A7B. How much will A get?

1422


Each side of a rectangle is increased by 100% .By what percentage does the area increase?

1117


Find the next series: AE BH CM DU?

1376