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
The hour hand lies between 3 and 4. Tthe difference between hour and minute hand is 50 degree.What are the two possible timings?
A man spending half of his salary for house hold expenses, 1/4th for rent, 1/5th for travel expenses, a man deposits the rest in a bank. If his monthly deposits in the bank amount 50. What is his monthly salary ?
sum of 5 consecutive numbers is 35. how many of the numbers are prime:
A person starts walking at a speed of 5km/hr through half the distance, rest of the distance he covers with a speed 4km/hr. Total time of travel is 9 hours. What is the maximum distance he can cover?
f(X)= 2X-1 + f(X-1) if X is not equal to zeroandiff(X=0)=0, Value of f(16)+f(15)-480
One dog tells the other that there are two dogs in front of me. The other one also shouts that he too had two behind him. How many are they?
In a two-dimensional array, X (9, 7), with each element occupying 4 bytes of memory, with the address of the first element X (1, 1) is 3000, find the address of X (8, 5).
a person who decided to go weekend trip should not exceed 8 hours driving in a day average speed of forward journey is 40 mph.due to traffic in sun days the return journey average speed is 30 mph.how far he can select a picnic spot.
4i+8j+10k. something like this.
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?
The sum of the series 1 + 1(1+1/n) + 3(1+1/n)2 + ..... is equal to?
mention your extra-curricular interest. Which do you actively pursue? how do you see these developing in the future?
A car is filled with four and half gallons of oil for full round trip. Fuel is taken 1/4 gallons mor3 in going than coming. What is the fuel consumed in coming up?
A and B decide to speak truth or lie on a day. Another person asks A if he is saying truth or lie. B listens to A whatever he answers. Now the person asks B what A had told. B replies as " A has told that he is a liar". What does B say?
A man drives at a speed of 40 miles/hr. His wife left 30 mins. late with 50 miles/hr speed. when will they meet ?