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?
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?
Copyright © 2021 Jogjafile Inc.
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: