print "What Book would you like to borrow? "; my $book_to_borrow =<STDIN>; chomp $book_to_borrow; if (exists($borrowed_DB{$book_to_borrow})) { if (defined($borrowed_DB{$book_to_borrow})) { print "This book is not available for checkout\n"; } else { print "This book is available for checkout. \nPlease type your name: "; my $borrower = <STDIN>; $borrowed_DB{$book_to_borrow} = $borrower; } } else { print "Sorry. Not Available.\n"; }
In reply to Hashes/ Simple Database by bmhm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |