I’m confused with the usage of square bracketed comma delimited elements in perl:
[short($file), -s $file];
Can somebody tell me what does this code mean?
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.
[]creates an array reference.[ $scalar, $scalar ]creates an array reference with two items in it.short($file)calls a subroutine and returns something (probably a scalar or a list of scalars)-s $filegives you the size of the file (as a scalar).[short($file), -s $file]gives you an array ref containing the above two things.