Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Use cases for 'sub Pckg::func { }' ?

by ikegami (Patriarch)
on Aug 01, 2020 at 06:38 UTC ( [id://11120173]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Use cases for 'sub Pckg::func { }' ?
in thread Use cases for 'sub Pckg::func { }' ?

I answered that. It's used every time you export something. e.g. use X qw( foo ); It allows foo to find other subs it should find and to use use vars vars it expects to find.

Replies are listed 'Best First'.
Re^4: Use cases for 'sub Pckg::func { }' ?
by LanX (Saint) on Aug 01, 2020 at 08:38 UTC
    Well, I'm asking about use cases for the syntax and you are describing the semantics .

    The exporter will certainly not apply a

    sub X::foo {Block}

    syntax.

    TIMTOWTDI, but in which circumstances would I want to "do it this way"?

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      I was replying to "What are the use cases of that pattern?", and the pattern was described as "where the anonymous sub carries its package context around." That is apparently not what you wanted.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120173]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-18 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found