local $/='//'; #define record separator my @records = <$in>; # read in all records chomp @records; #get rid of trailing // from each record #### local $/='//'; while (my $record = <$in>) { chomp $record; #remove // from end of line #... process the record ... }