develooper Front page | perl.beginners | Postings from April 2010

list assignment

Thread Next
From:
srd
Date:
April 20, 2010 08:46
Subject:
list assignment
Message ID:
a27311cf-9457-4d03-927a-fca1a5e14aa2@b39g2000prd.googlegroups.com
#!/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 message.

Can someone please explain why?


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About