[Perl-unix-users] printing hash values in a special order

2007-04-09 Thread Mehta, Perdeep
Hi, I have a hash with even numbers followed by odd numbers as values that I want to print in a certain order. I have tried my self several hours but couldn't work this out. Here is an example of input data. I will appreciate any help. %Values has following fields, name(Key) bands(Values) 143B

Re: [Perl-unix-users] printing hash values in a special order

2007-04-09 Thread Matt Schneider
Perdeep, I think this code should do what you are looking for: # retool your data into something more usable, a hash of arrays foreach $key (keys %Values) { # split the values for the key @values = split(/\s/, $Values{$key}); foreach $val (@values) { # set this value in an ar

Re: [Perl-unix-users] printing hash values in a special order

2007-04-09 Thread Mehta, Perdeep
Matt, Terrific! Thanks a lot. It really helped. perdeep -Original Message- From: Matt Schneider [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 1:14 PM To: Mehta, Perdeep; perl-unix-users@listserv.ActiveState.com Subject: RE: [Perl-unix-users] printing hash values in a special o