Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Perl 6 regexes via Pugs

schwennschwenn Posts: 1Member
Dear Jonathan,

I am trying to learn Perl 6 regexes via Pugs. I have the current win32 binary build (which includes a parrot.exe) available from the pugscode.org .

I get a parsing error on the pattern of any Perl 6 regex example I try and I think it maybe because Parrot is not being embedded or externally linked properly into the pugs.exe. Are there some environment variables or pugs environment commands I need to effect to get parrot to get asked to parse for pugs?

The error I get for perl 6 regexes (eg. for an example:

$string= "abacadabra";

$string ~~ m/a(.*)a/; ) is

*** Cannot parse PGE: a(.*)a

It doesn't make any difference whether the pattern is a(.*)a or something simpler or more complex - pugs can't parse the regex pattern whatever it is.

By the way, if there's some OTHER way than win32 binary-build pugs.exe to try out perl 6 regexes I would be very grateful for that just as well.


Thank you,

Peter Schwenn

Comments

  • JonathanJonathan Posts: 2,914Member
    Hi,

    : I am trying to learn Perl 6 regexes via Pugs. I have the current
    : win32 binary build (which includes a parrot.exe) available from the
    : pugscode.org .
    :
    I fear, that's the one that I produce.

    : I get a parsing error on the pattern of any Perl 6 regex example I try
    : and I think it maybe because Parrot is not being embedded or
    : externally linked properly into the pugs.exe. Are there some
    : environment variables or pugs environment commands I need to effect to
    : get parrot to get asked to parse for pugs?
    :
    : The error I get for perl 6 regexes (eg. for an example:
    :
    : $string= "abacadabra";
    :
    : $string ~~ m/a(.*)a/; ) is
    :
    : *** Cannot parse PGE: a(.*)a
    :
    : It doesn't make any difference whether the pattern is a(.*)a or
    : something simpler or more complex - pugs can't parse the regex pattern
    : whatever it is.
    :
    They actually don't use PGE any more, but switched to using PCR, and are embedding Perl 5. I think that my build was then missing some files needed to use regexes. I'm currently working on a fix for that - I'll get the new release up soon.

    : By the way, if there's some OTHER way than win32 binary-build pugs.exe
    : to try out perl 6 regexes I would be very grateful for that just as
    : well.
    You can always download Parrot and play with PGE directly, but the easy way is to use runpugs:

    http://feather.perl6.nl:8080/cgi-bin/runpugs?

    Have fun,

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Sign In or Register to comment.