Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I have trouble calling something "anonymous" which is accessible by a named variable.

perlglossary states

anonymous

Used to describe a referent that is not directly accessible through a named variable. Such a referent must be indirectly accessible through at least one hard reference. When the last hard reference goes away, the anonymous referent is destroyed without pity.

But I just recalled that Perl tends to use the label "__ANON__" for subs which were not bound to a package at creation time (i.e. created the usual way with sub name {} )

DB<22> use Carp qw/confess/ DB<23> $inner = sub { confess "INNER" } DB<24> sub outer { $inner->() } DB<25> outer() INNER at (eval 32)[C:/Perl_524/lib/perl5db.pl:737] line 2. main::__ANON__[(eval 32)[C:/Perl_524/lib/perl5db.pl:737]:2]() +called at (eval 33)[C:/Perl_524/lib/perl5db.pl:737] line 2 main::outer() called at (eval 34)[C:/Perl_524/lib/perl5db.pl:7 +37] line 2 ... #shortened outer(); ... #shortened DB<26> *inner = $inner DB<27> inner() INNER at (eval 32)[C:/Perl_524/lib/perl5db.pl:737] line 2. main::__ANON__[(eval 32)[C:/Perl_524/lib/perl5db.pl:737]:2]() +called at (eval 36)[C:/Perl_524/lib/perl5db.pl:737] line 2 ... #shortened inner(); ... #shortened

I think this is a confusing terminology which might have made sense in the time of Perl4.

But I see your point now.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

PS: Would be interesting to know if lexical subs are handled correctly here. (UPDATE: yes they are)


In reply to Re^11: Thx, St. Larry, for the Beauty of Sigils by LanX
in thread Thx, St. Larry, for the Beauty of Sigils by msouth

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-04-20 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found