News for hackers. Stuff that matters.
Re:Why perl has separate arrays and hashes: It's as if they ... by epochwolf on Tuesday June 21, 2011 @12:42PM (#2679407)
> I don't think that allowing you to iterate over a hash as if it were an array is all that unforgivable

Ruby allows this. Both arrays and hashes provide an each method and include the Enumerable module.

Re:Why perl has separate arrays and hashes: It's as if they ... by JulianMorrison on Tuesday June 21, 2011 @12:56PM (#2679477)
Ruby even makes it invisible because of destructuring assignment of block variables.

    ruby-1.9.2-p180 > {1=>2}.each {|k,v| puts "#{k} #{v}"}
    1 2
     => {1=>2} 
    ruby-1.9.2-p180 > {1=>2}.sort.each {|k,v| puts "#{k} #{v}"}
    1 2
     => [[1, 2]]