On Sun, Jul 27, 2003 at 11:59:59AM +0000, Pablo Fischer wrote:
> I have a Pretty class, with 15 methods (or more). I was reading a Perl 
> Tutorial and read that I could create local variables. So In many of my 
> methods Im using variables, but Im not declaring them like 'local $var', just 
> like 'my $var'.

[ snip ]

> And obviously, 'local $name', was 'my $name' and it was working so nice..
> 
> So is it necesary to declare the variables as local vars?

Not at all.  :-)

Have a look at perlsub -- the sections called "Private Variables with my()"
and "Temporary Variables with local()" are the official description of the
difference between these two.

There's also a very good article on scoping here:

    http://perl.plover.com/FAQs/Namespaces.html

-- 
Steve

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to