Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > About perl closure.

Reply
Thread Tools

About perl closure.

 
 
pswd
Guest
Posts: n/a
 
      04-06-2008
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!


 
Reply With Quote
 
 
 
 
John Bokma
Guest
Posts: n/a
 
      04-06-2008
"pswd" <(E-Mail Removed)> 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/
 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      04-07-2008
"pswd" <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 04-04-2011 10:00 PM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 02-27-2011 11:00 PM
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 02-03-2011 11:00 AM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 01-23-2011 05:00 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments