Re: list assignment

2010-04-22 Thread C.DeRykus
On Apr 20, 2:11 pm, dery...@gmail.com ("C.DeRykus") wrote: > On Apr 20, 9:38 am, jimsgib...@gmail.com (Jim Gibson) wrote: > > ... > > >> If we put $x=(1,2) then we get 2 without the error message. > > > >> Can someone please explain why? > > > > Yes, perl places the last item in the list into the v

Re: list assignment

2010-04-21 Thread Shawn H Corey
srd wrote: What really needs an explanation is if the array contains n elements then (n-2) warnings are emitted. maybe i was not so clear about my question Paul Johnson wrote: > On Tue, Apr 20, 2010 at 09:38:48AM -0700, Jim Gibson wrote: >> Yes, but as srd has observed, you get one fewer warni

Re: list assignment

2010-04-21 Thread srd
What really needs an explanation is if the array contains n elements then (n-2) warnings are emitted. maybe i was not so clear about my question -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: list assignment

2010-04-21 Thread C.DeRykus
On Apr 20, 9:38 am, jimsgib...@gmail.com (Jim Gibson) wrote: > On 4/20/10 Tue  Apr 20, 2010  9:25 AM, "Shawn H Corey" > scribbled: > > > srd wrote: > >> #!/usr/bin/env perl > >> use warnings; > >> use strict; > >> my $x= (1,2,3); > >> print $x,"\n"; > >> exit(0); > >> *

Re: list assignment

2010-04-20 Thread Paul Johnson
On Tue, Apr 20, 2010 at 09:38:48AM -0700, Jim Gibson wrote: > On 4/20/10 Tue Apr 20, 2010 9:25 AM, "Shawn H Corey" > scribbled: > > > srd wrote: > >> #!/usr/bin/env perl > >> use warnings; > >> use strict; > >> my $x= (1,2,3); > >> print $x,"\n"; > >> exit(0); > >> *

Re: list assignment

2010-04-20 Thread Jim Gibson
On 4/20/10 Tue Apr 20, 2010 9:25 AM, "Shawn H Corey" scribbled: > srd wrote: >> #!/usr/bin/env perl >> use warnings; >> use strict; >> my $x= (1,2,3); >> print $x,"\n"; >> exit(0); >> * >> output: >> Useless use of a constant in void context at ./try.plx line

Re: list assignment

2010-04-20 Thread Shawn H Corey
srd wrote: #!/usr/bin/env perl use warnings; use strict; my $x= (1,2,3); print $x,"\n"; exit(0); * output: Useless use of a constant in void context at ./try.plx line 4. 3 * If we put $x=(1,2) then we get 2 without the error