Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

(Ovid) Re(2): Thoughts on Perl6 - Love it? Hate it?

by Ovid (Cardinal)
on Jan 10, 2002 at 22:39 UTC ( #137808=note: print w/replies, xml ) Need Help??

in reply to Re: Thoughts on Perl6 - Love it? Hate it?
in thread Thoughts on Perl6 - Love it? Hate it?

Just out of curiosity, I know there's still a lot up in the air (err?), but won't this be a syntax error?

@seen{@data} ^= 1;

You have an @ to designate "seen" as an array (Perl6 terminology, folks!, I know that's not correct for Perl5), but you're using the curlies for a hash. I am assuming that what you meant to do was use a hash slice of elements in @data and set all elements to 1 (true). If so, I believe that would be:

%seen{@data} ^= 1;

For those not familiar with Perl 6 idioms, that would be the equivalent of the following in Perl 5:

@seen{@data} = (1) x @data; # or foreach (@data) { $seen{ $_ } = 1; }


Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Replies are listed 'Best First'.
Re: (Ovid) Re(2): Thoughts on Perl6 - Love it? Hate it?
by japhy (Canon) on Jan 10, 2002 at 23:54 UTC
    Dammit. Old habits die hard. I'm going to get flooded with those error messages, I'm sure.

    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://137808]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2020-11-30 04:57 GMT
Find Nodes?
    Voting Booth?

    No recent polls found