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 should be the age of sameer when his best friends age is 22 at the time of his graduation

1 Answers  


A store owner decided to raise the price of a particular item by exactly 10%. Of the following which is NOT the new price? A)$1.10 B)$8.80 C)$11.00 D)$57.30 E)$78.10

2 Answers   MIT, Wipro,


If on an item a shop gives 25% discount, they earn 25% profit. If they now give 10% discount then what is the profit percentage

27 Answers   Deloitte,


Pls send me last 3years questions of Karur Vaisya Bank

1 Answers   HP, Karur Vysya Bank KVB,


If the equation x2 - 3x + a = 0 has the roots (0,1) then value of a is ?

0 Answers   Flipkart, Wipro,


I have sample questions for QUANTITATIVE APTITUDE for bank test. Those who want this can contact me : beenasbi@gmail.com

96 Answers   ADB, Banking, FCMB, Infosys, ISRO, Soneri Bank, UCO Bank,


A number, when it is divided by 8 it gives a remainder 3 and is divisible by both 3 and 5. Find the number.

0 Answers   Cap Gemini,


London time is five and a half hours behind Delhi time. What time is it in London if it is 02:35 in Delhi? (a) 21:05 (b) 08:05 (c) 21:35 (d) 07:05 (e) None of these

14 Answers  


A person has Rs 100/- in his pocket, he can as 25 pencils or 15books.He kept 15% of the money for travelling expenses and purchased 5 pencils.So how many books he can purchase with the remaining money. a) 4 b) 3 c) 5 d)none

11 Answers   IBM,


What is degree of a Relation?

0 Answers   Aricent,


please send general aptitude questions with their answers

0 Answers   BPCL Bharat Petroleum, HPCL,


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