Re: my $variable verse $variable

2007-08-12 Thread Jeff Pang
-Original Message- >From: TMC <[EMAIL PROTECTED]> >Sent: Aug 11, 2007 10:41 PM >To: beginners@perl.org >Subject: my $variable verse $variable > >Greetings, >Being new to perl can someone explain why my is in form of variables >and what is the purpose? > Hello, See this good article,whic

Re: my $variable verse $variable

2007-08-12 Thread Mr. Shawn H. Corey
Paul Lalli wrote: If you type: use strict; at the top of your program, Perl will force you to "fully qualify" all of your global variables. That is, to name them with their package name in addition to the actual variable name. So the variable $foo in package main must actually be called $main::

Re: my $variable verse $variable

2007-08-12 Thread Paul Lalli
On Aug 11, 10:41 pm, [EMAIL PROTECTED] (Tmc) wrote: > Being new to perl can someone explain why my is in form of variables > and what is the purpose? You should have a read of: http://perl.plover.com/FAQs/Namespaces.html Basically, there are two kinds of variables in Perl. Global variables, whic

Re: my $variable verse $variable

2007-08-12 Thread Mr. Shawn H. Corey
TMC wrote: Greetings, Being new to perl can someone explain why my is in form of variables and what is the purpose? 'my' is used to declare a variable and limit its scope. If you `use strict;` (and you should) you must declare all unqualified variables. #!/usr/bin/perl use strict; use warn