Re: context, printing, and concatenation

2003-06-25 Thread David Storrs
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; > >

RE: context, printing, and concatenation

2003-06-24 Thread NYIMI Jose (BMB)
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

Re: context, printing, and concatenation

2003-06-23 Thread Jeff 'japhy' Pinyan
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

Re: context, printing, and concatenation

2003-06-23 Thread Paul Johnson
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