Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!sunic!bmc!kuling!jand From: jand@kuling.UUCP (Jan Dj{rv) Newsgroups: comp.lang.perl Subject: Which variables must be local ? Message-ID: <1421@kuling.UUCP> Date: 27 Feb 90 22:46:40 GMT Reply-To: jand@kuling.UUCP (Jan Dj{rv) Organization: Dept. of Computer Systems, Uppsala University, Sweden Lines: 15 I have never quite figured out if the "predefined" variables like $_, $1, $2, $' and so on must be declared as local when used in a sub. My scripts seem to work regardless... If there are some variables that are automatically local, I'd like to know which. If not, may I suggest that variables in pattern matching ($, $', $`, $+, $&) and $_ be made automatically local in subs. Just curious, Jan D.