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

Which has highest precedence in between list and terms? Explain?

0 Answers  


What are scalars in perl?

0 Answers  


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

1 Answers  


What is -> symbol in perl?

0 Answers   HCL,


What is use of ‘->’ symbol?

0 Answers  


what is the difference b/w coldfusion MX 6 and Coldfusion MX 7?

1 Answers  


what is CPAN?

0 Answers  


Which functions in perl allows you to include a module file. State their differences.

0 Answers  


Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?

0 Answers  


Explain join function in perl?

0 Answers  


Can inheritance be used in perl? Explain with the help of an example.

0 Answers  


How to replace perl array elements?

0 Answers  


Categories