<?xml version="1.0" encoding="windows-1252"?>
<node id="194587" title="local vs my" created="2002-09-02 10:27:12" updated="2005-06-15 06:14:41">
<type id="115">
perlquestion</type>
<author id="194582">
rzward</author>
<data>
<field name="doctext">
Hello,

&lt;p&gt;I have a script that makes heavy use of 'local' rather than 'my'. This is because the script was originally written in 1996 and supporting Perl 4 was important. I have updated and enhanced the script quite a bit and have up to now decided to not use 'my' because I didn't see a real need.

&lt;p&gt;I would now like to use 'use strict' but 'use strict' doesn't regard 'local' as a way of defining a variable, so I get many "... requires explicit package name at..." messages.

&lt;p&gt;I remember reading somewhere that 'local' works whereas 'my' doesn't when dealing with file handles... Am I remembering incorrectly? I can't find this.

&lt;p&gt;I am now considering changing all occurrences of 'local' in the script to 'my' but am worried that this will break the code. Are there places where I can read about the differences between 'my' and 'local'?

&lt;p&gt;Thanks in advance.

&lt;p&gt;Richard</field>
</data>
</node>
