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
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?
In simple interest what sum amounts of Rs.1120/- in 4 years and Rs.1200/- in 5 years.
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.
If "PROMPT" is coded as QSPLOS ,then "PLAYER" should be?
In a classroom, a student is ranked 12th from right and 9th from left. How many students are there in total?
How many 3-digit numbers with atleast one 5 in their digits?
Find the least value of 3x + 4y if x2y3 = 6.
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?
what is the largest prime number in 8 digit number?
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.
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?
aptitude questions
A&B fill 3 litres and 5 litres of oil in the car. C pays Rs. 8/- to A7B. How much will A get?
Each side of a rectangle is increased by 100% .By what percentage does the area increase?
Find the next series: AE BH CM DU?