What does the following perl code aim to do?
$logline{$cod}{s1} = scalar keys %{$valid{$cod}};
“valid” should be treated as a hashref, and $cod should be treated as a key. Is that right?
what does “s1” in the left hand stand for, a key again?
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.
RHS
Get the value of
%validindexed by$cod.Treat that value as if it were a hashref.
Get a list of keys of that hashref.
Find out how many keys are in that list.
(This is not how it actually works, instead
keyscalled in scalar context returns a number representing how many elements it would have returned had it been in list context.)LHS
The hash
%loglineis indexed by$cod.Which is itself a hashref, which is indexed by
s1.Bring it all together
The value of the first segment is stored at the position indicated by the second