On Mon, Mar 25, 2013 at 11:01 AM, <phi...@free.fr> wrote: > I have created a file called SalesReport.mp6, which contains a grammar > > module SalesReport; > grammar SalesExportGram is export {
Aiui you can now use this module to introduce SalesReport as a module name and SalesExportGram as a grammar name. > which I would like to use in the following PERL 6 script: > > use SalesReport; > my $parsed = SalesReportGram.parsefile('sales_report.txt'); As Brandon noted, SalesReportGram is misspelled in this case. Aiui SalesExportGram ought to work. > If I give the module (SalesReport.pm6) and the grammar > declared in it (grammar SalesReport) the same name, I get > "no such method 'parsefile' for invocant of type 'SalesReport'": > > my $parsed = SalesReport.parsefile('sales_report.txt'); Is SalesReport resolving to the module (which does not have a method 'parsefile')? To see if this is so, try: say SalesReport.HOW # how is SalesReport handled? What version of Perl 6 are you using? If I correctly understand what I just checked, SalesReport.parsefile() should work. > Any suggestions? The best place to get answers to these sorts of questions is the freenode IRC channel #perl6. Feel free to email me if you would like help getting going with IRC. If you really want/need to use a mailing list, consider posting to the perl6-users list. This perl6-language list is intended for posts related to language design. (Which is why just about the only traffic is the slow trickle of updates to the language specification, which is relatively stable, and a very occasional burst of discussion about some topic. It may get noisier in the second half of this year when concurrency starts to get a work through, but I think most of that will be on #perl6 too.) Hth, -- raiph