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.



Types of attribute and then describe it...

Answer / 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

More General Aptitude Interview Questions

What is the difference between a seed cotyledon and a seed endorsperm?

1 Answers  


'X' liters of petrol can be filled in an automobiles tank. What part of full tank was removed, if 'Y' liters was removed when the tank was full?

0 Answers   3i Infotech,


Number Series 14,2,12,4,10,6,?

9 Answers   TCS,


A 10 digit number N has none of its digits reapeating. The first two digits me N are divisible by two, the first 3 digits are divisible by 3, and the first 4 digits are divisible by 4 and so on such that the entire number is divisible by 10. find N.

11 Answers   TCS,


A sequence is given. You should find out error & write correct answer. 1 2 5 10 13 26 29 48.

5 Answers  


A says " the horse is not black". B says " the horse is either brown or grey." c says " the hoese is brown" At least one is telling truth and atleast one is lying. tell the colour of horse.

14 Answers   Cognizant,


A man travelled from the village to the post-office at the rate of 25 kmph and walked back at the rate of 4 kmph. If the whole journey took 5 hours 48 minutes, find the distance of the post-office from the village

0 Answers   Accenture,


sir, i need help in preparing the exam .so, please help me by sending some question papers to my mail address neela_david@rediffmail.com

1 Answers   Banking, Central Bank of India,


what was the nick name of Jai prakash narayan?

4 Answers  


sir i want the book for managerial aptitude for apsrtc jobs.if u know send to my mail arun9risingsun@yahoo.com

2 Answers   APSRTC,


A gardener plants 100 meters towards east, next 100 meters towards north,next 100 meters towards west. 98 meters towards east, 96 meters towards north and 96 meters towards west, 94 towards west. 98 meters towards east, 96 meters towards north and 96 meters towards west, 94 meters towards south. and 94 meters towards east and so on. If a person walks between the trees what is the total distance travelled by him before he reaches the center.

0 Answers   Infosys,


In which of the system a) decimal no. 384 is equal to 1234 b)decimal no. 362 is given by (1362)x in the X system of numbers.

1 Answers   TCS,


Categories