: my in the perl syntax
Date: Fri, 06 Feb 2004 07:57:39 -0500
Hi the best to understand is like in the next code
snippet:
sub SubA
{
my $var1 ;
}
In this function the var $var will be local and so
can not be accessed
from outside. (Or if you have a global variable
$var, it's actual
Harshal Borade wrote:
I certainly appreciate the pain you have gone through
in writing that mail, but I haven't understood about
perldoc -f my. I went through a book , How to Perl
5, last night. And it says that every variable
declared gets into main, a default package. To avoid
the namespace
Harshal Borade wrote:
I certainly appreciate the pain you have gone through
in writing that mail, but I haven't understood about
perldoc -f my.
It is meant to be entered exactly as written on the command-line. It is the
same way we call Perl programs:
perldoc -f my
is a call to the perldoc
Well I am very new to Perl. I have read Oreily's
Camel book, but haven't found any thing about
my that is used in any of the code.
e.g
my $var
What is my supposed to be over here?
Yahoo! India Mobile: Download the
There is definitely an explanation in the Camel (Chapter 4.8.1, Scoped variable
declarations).
my $var declares a lexical variable, i.e. a variable with limited scope (where the
scope is limited by an enclosing block, such as a subroutine, a conditional loop etc.).
HTH,
Jan
Harshal Borade
Harshal borade wrote:
Well I am very new to Perl. I have read Oreily's
Camel book, but haven't found any thing about
my that is used in any of the code.
e.g
my $var
What is my supposed to be over here?
I am new as well and by lurking in the groups I can tell you with great
certainty to use
From: Robert [EMAIL PROTECTED]
Subject: Re: my in the perl syntax
Date: Fri, 06 Feb 2004 07:57:39 -0500
Hi the best to understand is like in the next code snippet:
sub SubA
{
my $var1 ;
}
In this function the var $var will be local and so can not be accessed
from outside. (Or if you
Well I am very new to Perl. I have read Oreily's
Camel book, but haven't found any thing about
my that is used in any of the code.
e.g
my $var
What is my supposed to be over here?
Since the Camel is a reference more than a tutorial and because it is
already a pretty thick tome
Harshal borade wrote:
Well I am very new to Perl. I have read Oreily's
Camel book, but haven't found any thing about
my that is used in any of the code.
e.g
my $var
What is my supposed to be over here?
Perhaps this article will help you understand: