in reply to Re: Re: Hashes/ Simple Database
in thread Hashes/ Simple Database

How are you building your hash?
If I was doing this I might use a hash of hashes such as:
$book{author}{book_name} = $borrower; which you could output all in one swoop with
for my $author (keys %book) { print FILE $author; while (my ($book,$borrow) = each %{$book{$author}}) { print FILE ':' . $book; print FILE '/' . $borrow if $borrow; } print FILE "\n"; }
The input is of course comparable.
If you are using (as you seem to be) keys which are the author's name joined to the book title I would say you are making trouble for yourself and making the output code harder than it should be.

Note: since this is homework I probably should not have given you that code, but well I did anyway....