[LA.pm] list/scalar context

cch2cch@netscape.net cch2cch at netscape.net
Thu Jul 28 12:14:02 PDT 2005


the following statement is similar to the one on P.49 of "Programming Perl" 2nd Edition. $cnt does prodcues a value 3. But it seems a bit counter intuitive to me ( I think it should be a 2).

$cnt=(($x,$y)=(1,2,3)); # p.49 "Programming Perl 2nd edition
print "cnt=$cnt x=$x y=$y\n";

Particularly when in this statement only two elements survive the assignment.

@cnt=(($x,$y)=(1,2,3));
print "array cnt=@cnt\n";

__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp


More information about the Losangeles-pm mailing list