Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

About perl closure.

0 views
Skip to first unread message

pswd

unread,
Apr 5, 2008, 11:59:26 PM4/5/08
to
I have little idea about what are closures for perl?
Is it just a function maker that returns a reference of subroutine?

Could anybody tell me what it is and show me some examples?

Thanks in advance!


John Bokma

unread,
Apr 6, 2008, 12:27:42 AM4/6/08
to
"pswd" <lof...@gmail.com> wrote:

> I have little idea about what are closures for perl?
> Is it just a function maker that returns a reference of subroutine?
>
> Could anybody tell me what it is and show me some examples?

perldoc -q closure

--
John

http://johnbokma.com/perl/

xho...@gmail.com

unread,
Apr 7, 2008, 12:34:25 PM4/7/08
to
"pswd" <lof...@gmail.com> wrote:
> I have little idea about what are closures for perl?
> Is it just a function maker that returns a reference of subroutine?

I think the thing that makes a code-ref a "closure" is that any
enclosing-scoped lexical variables appearing in them have their ref-counts
incremented, and thus can't be freed until after the closure itself is
destroyed.

>
> Could anybody tell me what it is and show me some examples?

try perldoc -q closure

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.

0 new messages