# File: dbmAsk.pl # Title: Data Base Management # Author: Mihaela Malita # Read a data base and modify # try first: > perl dbm0.pl # Create the database # all the info is in the dbm0.pag database same directory dbmopen(%Studs,"dbm0",UNDEF); # permission mode 0644 or UNDEF # links (ties) %Studs to dbm0.pag - should be on the disk # reads and prints all the students from the database: dbm0 while (($key, $value) = each (%Studs)) { #reads data base dbm0 print "$key $value \n"; } print "\nPlease enter a student first name? "; $first = ; chop($first); $last = $Studs{$first}; # looks for value for the given key if ( $last ) { print "Found student: $Studs{$first} "; } else { print "Not Found!\n "; } dbmclose(%Studs); #data base has been modified!! exit;