in reply to Re: Re: string context and list operators (was Re: Array in scalar context.)
in thread Array in scalar context.
7. When you said in your first reply that, "join function is a list operator, like print" are you refering to the syntactial behavior of print (because it can take an array as one of it's arguments) instead of the symantics of it ? Similarly when you say "print function flattens the list and processes each of the elements in string context, are you refering to it's symantics ?No. join is a function, not an operator.
use strict; use warnings; my @stuff = 1 .. 10; print( join(' a ',@stuff), $/ ); print( scalar join(' a ',@stuff), $/ ); __END__ 1 a 2 a 3 a 4 a 5 a 6 a 7 a 8 a 9 a 10 1 a 2 a 3 a 4 a 5 a 6 a 7 a 8 a 9 a 10
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: string context and list operators (was Re: Array in scalar context.)
by jonadab (Parson) on Oct 13, 2003 at 14:05 UTC | |
|
Re: Re: Re: Re: string context and list operators (was Re: Array in scalar context.)
by Anonymous Monk on Oct 13, 2003 at 11:37 UTC |