On Jun 22, Peter said:

>print @array . "\n";
>print @array;
>
>Can you explain why the first print statement prints "3" (and a carriage
>return) while the second prints "onetwothree"?  My understanding is that
>the first print sees the array in scalar context while the second sees
>it in list context, but if so I don't understand why.  Can someone break
>it down what the concatenation operator is doing here?

The concatenation operator joins two SCALARS together.  That means that
its two arguments will be evaluated in scalar context, so it's like saying

  print( (scalar(@array) . "\n") );

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to