Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uwm.edu!psuvax1!news From: flee@guardian.cs.psu.edu (Felix Lee) Newsgroups: comp.lang.perl Subject: Re: local($foo) = ; in sub is a no-no, I guess.. Message-ID: Date: 21 Jul 90 21:00:48 GMT References: <1990Jul21.013619.2319@aai.com> Sender: news@cs.psu.edu (Usenet) Organization: Penn State Computer Science Lines: 12 Nntp-Posting-Host: guardian.cs.psu.edu > local($line) = ; >didn't work as expected, but > local($line); > $line = ; local($line) is an array, so the gets evaluated in an array context, which sucks in the entire file as an array of lines. The first line gets put in $line, and the rest of the lines disappear. The distinction between array and scalar contexts can be nasty. -- Felix Lee flee@cs.psu.edu