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

3 machines can complete the work in 4,5, and 6 hours respectively. due to power failures they did the work alternatively. Then what is time taken to complete the work?

1 Answers   HCL,


if any one have the hpcl hr trainee papers plz send to me my paper on feb 2008

0 Answers   HPCL,


If the simple interest is 10.5 % annual and compound interest is 10 % annual, compounded annually, find the difference between the interests after 3 years on a sum of Rs. 1,000.

0 Answers   Essar,


There are n urns and m balls. If we put 3 balls in each urn 3 balls will be excess. If we put 4 balls in each urn 1 urn will be excess. Find no. of Urns (or) Balls?

8 Answers   Accenture, CTS,


THERE ARE 3 PILES OF BOOKS ON THE TABLE YOU NEED TO ARRANGE THEM IN THE SELF SUCH THAT 1ST BOOK OF EACH PILE GETS PLACED ON THE SELF,WHAT IS THE POSSIBLE NO OF ARRANGEMENTS

0 Answers   CSC,


Two trains are travelline at equilateral .Train A is travelling in the direction of earths spin.Other train B is travelling in opposite direction of earths spin.Which trains wheels will wear first?and why?

0 Answers   Accenture,


In a family Reshma is elder sister of Ragini . Soni is Reshma's daughter and Saloni is Soni's cousin. Rgini's mother is Rajani. Ramani is the sister-inlaw of Reshma. Who is Soni's grandmother?

0 Answers   Wipro,


) Peter and Paul are two friends. The sum of their ages is 42 years. Peter is twice as old as Paul was when Peter was as old as Paul is now. What is the present age of Peter?

9 Answers   TCS,


Hi... this is pankaj (final yr chemical engg)..i am appearing for officer trainee exam at 22nd feb.. plz tell me which book to refer for hpcl exam aptitude test and plz help if anyone has any clue about technical test..mail me at pankajbhole07@gmail.com.............

0 Answers  


if x=y=2z and xyz =256 then x=

0 Answers  


Prefix of (A+B)*C- (D-E)/(F+G)

3 Answers   TCS, Wipro,


In base 10 representation for a rupee 100 paise,then base 8 representation what is rupee value?

0 Answers   Wipro,


Categories