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 warnings;

my $a = 'a';

{
 my $a = 'b';
 print "$a\n";
}

print "$a\n";

__END__


See:
perldoc -f my
perldoc -f our
perldoc -f local
perldoc vars


--
Just my 0.00000002 million dollars worth,
 Shawn

"For the things we have to learn before we can do them, we learn by doing them."
 Aristotle

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to