Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Re: my least favorite perl feature

by waxmop (Beadle)
on Feb 05, 2003 at 21:40 UTC ( #232941=note: print w/replies, xml ) Need Help??

in reply to Re: my least favorite perl feature
in thread my least favorite perl feature

After breathing some Zen, I still wish there was some sort of 'object equivalence testing operator' in Perl. I could use it to compare two hashes, or two arrays, or objects, or whatever, and it would give me a same/not-same response.

Replies are listed 'Best First'.
Re: my least favorite perl feature
by Abigail-II (Bishop) on Feb 05, 2003 at 23:32 UTC
    Well, the question "when are two arrays the same" has never been answered in a way all people could agree on.

    Personally, I find the current behaviour of

    if (@array1 == @array2)
    very useful. I wouldn't want to miss it.

    Furthermore, you'd have a hard time convincing me that you need to do less work for redefining an operator than for defining a function. Why not create a function that compares two arrays?

    Lastly, perl6 will have a supermatching operator. It will do all kinds of different things, depending on the types of its operands. Perhaps your idea of comparing arrays is one of the possible options.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://232941]
[Corion]: Sane Dots Supplies - your brand manufacturer for satisfying experiences!
[choroba]: preparing the trip to Vietnam + buying a new car = enough fun
[Corion]: choroba: Yeah, that's a lot of "fun" for one week...
[Corion]: I guess I should stage some product photos for Sane Dots Supplies ;)
[marto]: I had some ideas about that Corion
[marto]: I'll send a message over the weekend maybe :P
[Corion]: choroba: I avoided the "fun" of emergency shopping for a new flat iron by trying the flat iron without the timer that sat between it and the mains power. Seems as if just the timer is broken.
[Corion]: marto: Heh, would be cool!
Corion munches on the traditional German winter fruit, strawberries. Imported from Spain at the price of EUR 0.77 per 150g - not really cheap but surprisingly good for a winter produce

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2017-01-20 10:19 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (174 votes). Check out past polls.