On Tue, Dec 1, 2009 at 10:56 PM, Ludwig Isaac Lim wrote:
>
> Can we say closures are anonymous coderefs that acesses a pre declared
> variable?
Nahuli na ba ako? :-) In Perl, a closure is just a subroutine that has
access to persistent private variables. It can either be a named subroutine
or
Hi!
On Tue, Dec 1, 2009 at 10:56 PM, Ludwig Isaac Lim wrote:
> Hi:
>
> I'm having some hard time understand perl closure:
>
> Here's an explanation from Intermediate Perl:
> "The kind of subroutine that can access lexical variables that existed at
> the time we declare it is called a closu
First of all, may I apologize for my lack of perl-fu so I may be doing
this wrong.
On Tue, Dec 1, 2009 at 10:56 PM, Ludwig Isaac Lim wrote:
> My question is "$total_size" is not out of scope since it is declared
> before "find(sub.." right?
Yes and no. Without strict, $total_size would still
Hi Ludwig,
"$total_size" is not out of scope because it is implicitly global
since it was not declared with "my" in the subroutine.
If you remove the initial declaration, the code still works.
If, within the subroutine, you do...
find (sub {my $total_size += -s if -f},'.');
... the c
Hi:
I'm having some hard time understand perl closure:
Here's an explanation from Intermediate Perl:
"The kind of subroutine that can access lexical variables that existed at
the time we declare it is called a closure .In Perl terms, a closure is
just a subroutine that references a
On Tue, Dec 1, 2009 at 2:44 PM, Daniel Escasa wrote:
> Choice quote: “Hey, if you just press Enter, it usually works out."
> http://www.fsdaily.com/Community/The_Un_Scary_Screwdriver, or
> http://www.gnomejournal.org/article/88/the-un-scary-screwdriverhttp://www.gnomejournal.org/article/88/the-un-
6 matches
Mail list logo