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
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
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/
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);
> >> *
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);
> >> *
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
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