in reply to Sorting a nested hash on internal values

foreach $job (sort { jobs{$job}{start_date} <=> $jobs{$job}{start_date}} keys %jobs) {
I think you want
foreach $job (sort { jobs{$a}{start_date} <=> $jobs{$b}{start_date}} keys %jobs){
Also, I'm not sure the logic is correct in the /END/ section; do you really want to delete any job that has an END section? Surely instead you want, at the end, to delete any jobs that didn't have an END section ?

Replies are listed 'Best First'.
Re: Re: Sorting a nested hash on internal values
by Anonymous Monk on May 12, 2004 at 16:05 UTC
    Yes, $jobs{$a}{start_date}<=>$jobs{$b}{start_date} is what I wanted. I woke up this morning, and that was in my head. I feel a little silly.

    As for the END logic: Any job that doesn't have an /END/ has not been dealt with (no quota has been subtracted), So I want to keep non-/END/ jobs to be dealt with. I think I ought to just flag the /END/ers as dealt with, and not delete them though.

    Thanks for your help. I really appreciate someone pouring over my copious amounts of text to help out.

    Louie