#!/usr/bin/perl
# w6.2.pl:  Access info in flat data file w6.2.fdb

undef($/);			#no boundaries; data read as 1 string
open (FH, "w6.2.fdb");

$contents = <FH>;

@records = split(/^Last:/m, $contents); 
shift(@records);

foreach (@records){
   $_ = "Last:" . $_; 
   m/^Color: (.*)/m;
   $color= $1;
   m/^Last: (.*)/m;
   $last= $1;
   print("$last likes $color.\n");
}
close (<FH>);





