dakkar has asked for the wisdom of the Perl Monks concerning the following question:

I tried the following code:

print "Yes\n" if "0" =~ /0/; print ("0" =~ /0/); print "\n";

In Perl5 it prints:

Yes
1

as I expected. In Perl6 it prints:


Yes, just an empty line.

If I change all the 0s to 1s, it prints:

Yes

What is the match returning?

Replies are listed 'Best First'.
Re: Perl6 pattern match return value
by Elian (Parson) on Oct 06, 2002 at 15:54 UTC
    If this is in the repository version of perl 6, it's likely a bug. Send mail to bugs-parrot at perl 6 dot perl dot org (yeah, I know, but there's enough spam to deal with on the bug lists as it is) with a description of the problem and source--what you have here is enough--and we'll see about figuring out why and getting it fixed.
Re: Perl6 pattern match return value
by kelan (Deacon) on Oct 06, 2002 at 15:31 UTC
    It might just be a bug. Perl6 is obviously still under heavy construction. I haven't compiled or used the existing version at all, but it certainly looks like what you have should do the same thing as in Perl5. I would contact the Perl6 developers and ask them. Perhaps they know about it and it's being worked on, or they don't know and it could help them out.

    kelan


    Yak it up with Fullscreen ChatterBox