The document you refer to describes Perl 6. What version are you trying this with?
In reply to Re: function called by regex by kyle in thread function called by regex by spx2