On Mon, Jun 23, 2003 at 11:13:00PM -0500, Peter wrote:
> I'm on the first few chapters of "Learning Perl" and came up with a
> question. Given:
>
> -
>
> @array = qw ( one two three );
> print @array . "\n";
> print @array;
>
>
Because in the first statement @array is used in scalar context so it's like you wrote
something as
[EMAIL PROTECTED];
print $size."\n";
That's why you get the number of items contained in @array which is 3.
HTH,
José.
-Original Message-
From: Peter [mailto:[EMAIL PROTECTED]
Sent: Tue
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 cont
Peter said:
> I'm on the first few chapters of "Learning Perl" and came up with a
> question. Given:
>
> -
>
> #!/usr/bin/perl
>
> @array = qw ( one two three );
> print @array . "\n";
> print @array;
>
> -
>
> Can you explai