in reply to Pugs configuration - file locations

You seem to be quite excited about pugs and Perl 6, so I strongly recommend you join the IRC channel #perl6 on irc.freenode.net, that's where the developers hang out.

Regarding your problem: Pugs implements regexes and rules via the Perl 5 Module Pugs::Compiler::Rule, which is called through the perl 5 interpreter which is linked into pugs.

So I guess it uses PERL5LIB to search for the module, not PERL6LIB, and not Perl 6's @*INC. (Yes, it shoudl be @*INC, not @INC, unless I'm very much mistaken). I don't have a pugs installation available to try it, though.

Replies are listed 'Best First'.
Re^2: Pugs configuration - file locations
by John M. Dlugosz (Monsignor) on Feb 27, 2008 at 08:48 UTC
    That's it. Setting PERL5LIB got past that problem. Now I get
    pugs> my $z= "abc12345we678" "abc12345we678" pugs> $z ~~ ?/\d+/ *** Cannot parse regex: \d+ *** Error: Error: Can't use string ("1") as a subroutine ref while "st +rict refs" in use at D:\pugs\perl5\Pugs-Compiler-Rule\lib/Pugs /Compiler/Regex.pm line 85. Bool::False pugs>
    Owell...

    —John
    in Allen, Texas (Dallas metroplex)

      The question mark shouldn't be there. Just $z ~~ /\d+/.

      If you want to coerce that to boolean context, the question mark has to be in front of the expression:

      my $bool = ? $z ~~ m/\d+/
      (Don't know if ~~ or ? has the higher precedence, so you might need parenthesis. But I don't think so ;)
        Why?

        It seems more reasonable to tell the regex engine it has an easier job, close to where it is invoked rather than converting the result. IAC, both forms are taken by Pugs, and every variation (even with no ? ) give the same error.