Re: populating a hash slice from a filehandle

2008-06-23 Thread Jenda Krynicky
From:Bryan R Harris <[EMAIL PROTECTED]> > Jenda wrote: > > From: Bryan R Harris <[EMAIL PROTECTED]> > >> It makes more sense to me that (,) is kind of the same thing as > >> saying (@a,@b). In list context @a returns the array as a list, but in > >> scalar context @a returns the number of elements

Re: populating a hash slice from a filehandle

2008-06-23 Thread Bryan R Harris
> From: Bryan R Harris <[EMAIL PROTECTED]> >>> Bryan R Harris wrote: John W. Krahn wrote: > > Bryan R Harris wrote: >> >> John W. Krahn wrote: >>> >>> The left hand side of the assignment determines context so the @l2r{...} >>> part. >> >> That st

Re: populating a hash slice from a filehandle

2008-06-23 Thread Jay Savage
On Fri, Jun 20, 2008 at 4:52 PM, Bryan R Harris <[EMAIL PROTECTED]> wrote: > >> Bryan R Harris wrote: >>> >>> John W. Krahn wrote: Bryan R Harris wrote: > > John W. Krahn wrote: >> >> The left hand side of the assignment determines context so the @l2r{...} >> part. >>>

Re: populating a hash slice from a filehandle

2008-06-21 Thread Jenda Krynicky
From: Bryan R Harris <[EMAIL PROTECTED]> > > Bryan R Harris wrote: > >> > >> John W. Krahn wrote: > >>> > >>> Bryan R Harris wrote: > > John W. Krahn wrote: > > > > The left hand side of the assignment determines context so the @l2r{...} > > part. > > That strik

Re: populating a hash slice from a filehandle

2008-06-20 Thread Bryan R Harris
> Bryan R Harris wrote: >> >> John W. Krahn wrote: >>> >>> Bryan R Harris wrote: John W. Krahn wrote: > > The left hand side of the assignment determines context so the @l2r{...} > part. That strikes me as odd... When perl goes to populate @l2r{"a","b"}, it >>

Re: populating a hash slice from a filehandle

2008-06-20 Thread John W. Krahn
Bryan R Harris wrote: John W. Krahn wrote: Bryan R Harris wrote: John W. Krahn wrote: The left hand side of the assignment determines context so the @l2r{...} part. That strikes me as odd... When perl goes to populate @l2r{"a","b"}, it seems to me that it would go through this process:

Re: populating a hash slice from a filehandle

2008-06-20 Thread Bryan R Harris
> Bryan R Harris wrote: >> >> John W. Krahn wrote: >>> >>> Bryan R Harris wrote: > Jenda Krynicky wrote: > > Context. The returns a single line in scalar context and > a list of all lines in a list context. And there is no such thing as > a two-item-list context.

Re: populating a hash slice from a filehandle

2008-06-19 Thread John W. Krahn
Bryan R Harris wrote: John W. Krahn wrote: Bryan R Harris wrote: Jenda Krynicky wrote: Context. The returns a single line in scalar context and a list of all lines in a list context. And there is no such thing as a two-item-list context. So in the first case the assignment to @l2r{"a","b

Re: populating a hash slice from a filehandle

2008-06-19 Thread Bryan R Harris
> Bryan R Harris wrote: >>> From: Bryan R Harris <[EMAIL PROTECTED]> Given an open filehandle, why don't these two things do the same thing? ** @l2r{"a","b"} = (, ); $c = ; ** $l2r{"a"

Re: populating a hash slice from a filehandle

2008-06-19 Thread John W. Krahn
Bryan R Harris wrote: From: Bryan R Harris <[EMAIL PROTECTED]> Given an open filehandle, why don't these two things do the same thing? ** @l2r{"a","b"} = (, ); $c = ; ** $l2r{"a"} = ; $l2r{"b"} = ; $c = ;

Re: populating a hash slice from a filehandle

2008-06-19 Thread Bryan R Harris
> From: Bryan R Harris <[EMAIL PROTECTED]> >> Given an open filehandle, why don't these two things do the same thing? >> >> ** >> @l2r{"a","b"} = (, ); >> $c = ; >> >> ** >> $l2r{"a"} = ; >> $l2r{"b"} = ; >> $c = ; >> >> **

Re: populating a hash slice from a filehandle

2008-06-18 Thread Jenda Krynicky
From: Bryan R Harris <[EMAIL PROTECTED]> > Given an open filehandle, why don't these two things do the same thing? > > ** > @l2r{"a","b"} = (, ); > $c = ; > > ** > $l2r{"a"} = ; > $l2r{"b"} = ; > $c = ; > > *

Re: populating a hash slice from a filehandle

2008-06-18 Thread Jeff Peng
On Thu, Jun 19, 2008 at 5:50 AM, Bryan R Harris <[EMAIL PROTECTED]> wrote: > > > Given an open filehandle, why don't these two things do the same thing? > > ** > @l2r{"a","b"} = (, ); > $c = ; > because @l2r{...} is a list, right? so the statement above is in a

populating a hash slice from a filehandle

2008-06-18 Thread Bryan R Harris
Given an open filehandle, why don't these two things do the same thing? ** @l2r{"a","b"} = (, ); $c = ; ** $l2r{"a"} = ; $l2r{"b"} = ; $c = ; ** The first seems to be slurping the whole