in reply to Re^2: Help Me!
in thread Help Me!

Yes, but the OP is on his/her first Perl program. I don't see the need to use a hash in a first homework assignment - and especially not a hash slice which is certainly a more complex syntax than a simple hash assignment. Your code will not produce same order of output as the OP's code.

I figure that 2, one dimensional arrays are just fine for this first homework. Don't make it more complex than it needs to be!

updated: with strike-through.

Replies are listed 'Best First'.
Re^4: Help Me!
by jwkrahn (Abbot) on Apr 11, 2011 at 08:53 UTC
    Your code will not produce same order of output as the OP's code.

    If by the same order of output you mean "ID" first, then "Name", "Major" and finally "Email", then yes, the code I posted produces the same order.    I guess you don't understand how arrays work?    Or foreach loops?

      Your hash slice is fine, but not appropriate for a first Perl assignment. I updated an error on my part above.