Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!psuvax1!news From: flee@cs.psu.edu (Felix Lee) Newsgroups: comp.lang.perl Subject: Re: perl-4.010 bug on subroutine calls Message-ID: <045H#2l$@cs.psu.edu> Date: 27 Jun 91 23:18:01 GMT References: <1991Jun27.014208.27003@StarConn.com> Sender: news@cs.psu.edu (Usenet) Organization: Penn State Computer Science Lines: 12 Nntp-Posting-Host: dictionopolis.cs.psu.edu Richard Mann reports that $x = "black"; &bleach($x); print $x; sub bleach { local($x); $_[0] = "white"; } prints "black" rather than "white". This is the opposite of the old "variable suicide" problem. Before perl 3.042, the following $x = "black"; &print("white", $x); sub print { local($x, $y) = @_; print "$x $y"; } would print "white white" rather than "white black". -- Felix Lee flee@cs.psu.edu