On Fri, Aug 10, 2001 at 12:22:43AM +0300, raptor wrote:
thanx,
Yes I see ... but I was interested WHY when we are in nested subroutines ...
the inner-one will see the lexical var only the first time !! I mean the
Note that there are _no_ nested subroutines in Perl. You may declare
one inside
Note that there are _no_ nested subroutines in Perl ..So what you
basicaly have are two global subroutines with
local values. You get the closure for the first invocation. But it's
not the same variable anymore.
]- Now understand thanx alot
=
iVAN
[EMAIL PROTECTED]
=
hi,
I have the following situation ... it is not big issue but i'm interested
why this happen .. so here is it :
my $ID = 555;
print $ID;
sub blah {
..
{
local $$dbh{AutoCommit} = 0;
eval {
local $$dbh{RaiseError} = 1;
$ID = selectrow
Hello,
rI have the following situation... it is not big issue but
ri'm interested why this happen...
r
rmy $ID = 555;
rsub blah {
r...
r$ID = selectrow query;
r...
r}
This is, in fact, a big issue. You should see a message in your error log
shared variable
On Thu, Aug 09, 2001 at 01:36:28PM -0700, Andrew Ho wrote:
Hello,
rI have the following situation... it is not big issue but
ri'm interested why this happen...
r
rmy $ID = 555;
rsub blah {
r...
r$ID = selectrow query;
r...
r}
This is, in fact, a
thanx,
Yes I see ... but I was interested WHY when we are in nested subroutines ...
the inner-one will see the lexical var only the first time !! I mean the
REASON of this perl behaviour ! It it closer/easier to think of it that
my-vars are visible all the time in their inner scopes (except if u
So what is the REASON for this copy-on-first-call behaviour.(there have to
be some reason, if i'm not totaly dull to see it )
It's called a closure. You can read up on it in the Camel book or in Damian
Conway's OO book.
- Perrin
didn't thought of that :)), but what will broke if the var is
copied/aliased every time not just the first time ...
I mean the call to closure make a new instance of the sub() every time
isn't it ?!?
! I see the closures get bound every-time , but non closures only the
first time !
But
On Fri, Aug 10, 2001 at 01:08:12AM +0300, raptor wrote:
didn't thought of that :)), but what will broke if the var is
copied/aliased every time not just the first time ...
I mean the call to closure make a new instance of the sub() every time
isn't it ?!?
! I see the closures get
On Thu, 9 Aug 2001, Perrin Harkins wrote:
So what is the REASON for this copy-on-first-call behaviour.(there have to
be some reason, if i'm not totaly dull to see it )
It's called a closure. You can read up on it in the Camel book or in Damian
Conway's OO book.
oh even here:
10 matches
Mail list logo