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]?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program that shows the distinction between child and parent process?

982


How to renaming a file in perl programming?

1114


Explain the different types of data perl can handle.

944


How can I implement the function overloading in Perl ? I read about the operator overloading, I do not know how to implement the function overloading. Thanks in advance ?

2963


What does file test operators do in perl?

986


What is the different between array and hash in perl programming?

989


Explain ivalue?

1049


How to convert strings into an array in perl?

1061


How to open and read data files with Perl

1090


What syntax is used for grep() function?

1263


How do I send e-mail from a Perl/CGI program on a Unix system?

1058


How to merge two arrays in perl?

1108


Comment on data types and variables in perl.

981


Is there any way to add two arrays together?

1028


What are the advantages and disadvantages of perl language?

968