0 votes
in Perl by
What is use of ‘->’ symbol?

1 Answer

0 votes
by
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

Related questions

0 votes
asked Jul 26, 2023 in Perl by rahuljain1
0 votes
asked Nov 6, 2022 in Swift by rajeshsharma
...