Question:

What is use of ‘->’ symbol?

Answer:

In Perl, ‘->’ symbol is an infix dereference operator. if the right hand side is an array subscript, hash key or a subroutine, then the left hand side must be a reference.

@array = qw/ abcde/; # array
 
print "n",$array->[0]; # it is wrong
 
print "n",$array[0]; #it is correct , @array is an array

 


Keywords:

© 2017 QuizBucket.org