Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Disabling the interpretation of diamond <> operator in package?

by jimpudar (Pilgrim)
on Apr 10, 2018 at 00:20 UTC ( #1212617=note: print w/replies, xml ) Need Help??


in reply to Disabling the interpretation of diamond <> operator in package?

Hi LanX,

Try it like this:

DB<13> &bla < bla works at ...

I am not 100% clear on why this works, I would appreciate it if someone else might be able to explain it to us :D

Best,

Jim

  • Comment on Re: Disabling the interpretation of diamond <> operator in package?
  • Download Code

Replies are listed 'Best First'.
Re^2: Disabling the interpretation of diamond <> operator in package?
by LanX (Cardinal) on Apr 10, 2018 at 00:52 UTC
    Indeed thanks! :)

    see perlsub for the explanation:

    &NAME;       # Makes current @_ visible to called subroutine.

    It's a syntax to pass parameters through, so it can't accept new arguments.

    DB<27> sub tst { [@_] } DB<28> sub outer { &tst } DB<29> x outer(1,2,3) 0 ARRAY(0x2f700e8) 0 1 1 2 2 3 DB<30> x &tst 1,2,3 Number found where operator expected at

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

    update

    for clarification, while interesting, this doesn't answer my question and side effects are too weird...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2020-11-26 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?