Don't ask to ask, just ask | |
PerlMonks |
Re: Create a new operator, get LHSby raiph (Deacon) |
on Sep 11, 2015 at 15:50 UTC ( [id://1141680]=note: print w/replies, xml ) | Need Help?? |
In Perl 6, operators are defined by subs. Operator subs have to have an appropriate name and signature. They get automatically added to the Perl 6 grammar in the current lexical scope as soon as their name and signature have been successfully parsed. For example, infix operators have a name of the form 'infix:<op>' and two parameters. So the code:
prints (via `dd`, the built in datadumper):
For more details start at the Defining Operators section in the official end user doc.
»ö« . o O ( "the celebrity tell-all of the Perl-6 cult?" )
In Section
Seekers of Perl Wisdom
|
|