in reply to Re: Calling $function from $module
in thread Calling $function from $module

'fred::fred'->();;

Replies are listed 'Best First'.
Re^3: Calling $function from $module
by BrowserUk (Patriarch) on Aug 05, 2015 at 22:40 UTC

      He saying you could have used

      ( $p.'::'.$s )->()

      It's the alternate form of

      &{ $p.'::'.$s }()

      The following should be avoided since it inherits the parent's @_ rather than creating a new one:

      &{ $p.'::'.$s }

      I recommend against both of your solutions. The first (&{ $p.'::'.$s }) is wrong and the second (*{ $p.'::'.$s }->()) is weird.

        You're wrong about what "he is saying": constants aren't variables.

        His 'suggestions' are meaningless: constants aren't variables.

        *{ $p.'::'.$s }->() ... is weird

        Hm. I thought you'd like that one, since I learnt it from you.


        Anyone got any experience of this phone's predecessor?

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
        In the absence of evidence, opinion is indistinguishable from prejudice.
        I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
      (my $fred = 'fred::fred' )->();