Hash table Questions ...

drulea at grassvalleygroup.com drulea at grassvalleygroup.com
Mon Nov 27 20:02:01 CST 2000


Hi,

Quick question here. I have a hash table with the following fields:

$log_hash->{time} = $time;
$log_hash->{email} = $email;
$log_hash->{name} = $name;
$log_hash->{update} = $update;
$log_hash->{tag} = $tag;
$log_hash->{log} = $log;
$log_hash->{cr} = $CRnumber; 

I set searchable hash key value to the "$time" field in the following
manner: "$LOG_HASH { $log_hash->{time} } = $log_hash;"

The creation and print out of the hash table is OK. For print out, I use the
following:

foreach $elem ( keys %LOG_HASH )  # Print out the hash table
	{
		print OUT_HASH ("CR:$LOG_HASH{$elem}{cr} checked in to: ");
		print OUT_HASH ("$LOG_HASH{$elem}{tag} on: ");
	            print OUT_HASH ("$LOG_HASH{$elem}{time} by: ");
		print OUT_HASH ("$LOG_HASH{$elem}{name}\n");
	}

However, I'd like to print out each element of the hash according to its CR
value, not its time value. For example, I want all the hash values with CR
values = 1 printed first, next those with CR = 2, etc. Several elements in
the hash have identical CR values. Any ideas how to do this?

thanks,
Sherban  

______________________________________________________
Sherban Drulea
*    sherban.drulea at grassvalleygroup.com


TIMTOWTDI



More information about the Pdx-pm-list mailing list