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...


What is the difference between $array[1] and @array[1]?



What is the difference between $array[1] and @array[1]?..

Answer / kiruthikau

$array[1] represents a scalar value.
@array[1] represents array slicing.

@array[1] returns a list with one scalar value.

We should use $ when we want a scalar value.
If we want a list we need to use @.

If we use 'use warnings' then @array[1] will give the warnings
like ,Scalar value @array[1] better written as $array[1].

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

What is the use of -t?

0 Answers  


Mention how many ways you can express string in Perl?

0 Answers  


What is perl? What is the basic command to print a string in perl?

0 Answers  


How will you open a file in a write-only mode in perl?

0 Answers  


What is the difference between $array[1] and @array[1]?

1 Answers  


How do I sort a hash by the hash value?

0 Answers  


Write an example explaining the use of symbol tables.

0 Answers  


What does `$result = f() .. g()' really return?

0 Answers  


How to check the status of airplane mode (enable/disable) in perl for Android mobile?

0 Answers  


How to do comment in perl?

0 Answers  


what are the strategies followed for multiple form interaction in cgi programs?

0 Answers  


Why Perl aliases are considered to be faster than references?

0 Answers  


Categories