About perl closure.

Discussion in 'Perl Misc' started by pswd, Apr 6, 2008.

  1. pswd

    pswd Guest

    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!
     
    pswd, Apr 6, 2008
    #1
    1. Advertising

  2. pswd

    John Bokma Guest

    "pswd" <> 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/
     
    John Bokma, Apr 6, 2008
    #2
    1. Advertising

  3. pswd

    Guest

    "pswd" <> 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.
     
    , Apr 7, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JezB

    Page Closure

    JezB, Dec 3, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    435
    Cowboy \(Gregory A. Beamer\)
    Dec 3, 2003
  2. Ivan Sutton
    Replies:
    0
    Views:
    358
    Ivan Sutton
    Oct 1, 2003
  3. Simon
    Replies:
    3
    Views:
    5,254
    John C. Bollinger
    Jan 12, 2005
  4. bugbear
    Replies:
    11
    Views:
    599
    bugbear
    Sep 5, 2005
  5. Julian Mehnle
    Replies:
    0
    Views:
    239
    Julian Mehnle
    Jul 17, 2003
Loading...

Share This Page