Perl Operators   «Prev 

Named unary and list Operators

In the examples below, notice how the absence of parentheses changes what gets printed.
List operator examples
List operator examples

In the first statement, the join puts a colon between each element in the array first, then the print statement results in:
"string ","a:b:c:d:e:f",
"other things","\n" 

being printed.
The example above would normally appear on a single line. It is broken into multiple lines for readability.
In the second statement, the join puts a colon between each element in the array and the following two strings, then the print statement results in:
 
"string ",
"a:b:c:d:e:f:other things:\n"

being printed. The example above would normally appear on a single line. It is broken into multiple lines for readability.