Please, can anyone help me with this:
perl -e 'print for <{a,b,c}{1,2,3}>'
I just don’t understand how it works. And it works! Producing
a1a2a3b1b2b3c1c2c3
on output.
Does anyone know what is happening inside diamond operator?
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.
It’s another way to represent
globbing. Basically the curlies tell thegloboperator to take each comma-separated element inside and combine across all possibilities.A clearer way to see this is to comma-separate the individual outputs:
From
perldoc -f glob: