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

You effectively just repeated what I said without answering my question.

What are the use-cases where this idiomatic construct is useful?

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

  • Comment on Re^2: Use cases for 'sub Pckg::func { }' ?

Replies are listed 'Best First'.
Re^3: Use cases for 'sub Pckg::func { }' ?
by ikegami (Patriarch) on Aug 01, 2020 at 06:38 UTC

    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.

      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.