I am new to Perl and am curious whether @{$list_ref} and @$list_ref are perfectly equivalent.
They seem to be interchangeable, but I am nervous that there is something subtle going on that I may be missing.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, they’re equivalent. You need braces when the expression is more than a simple scalar variable, e.g.,
For more detail, see the Using References section of the documentation on references. The standard Perl documentation also includes several tutorials on using references: