local $/='//'; while (my $record = <$in>) { chomp $record; #remove // from end of line #... process the record ... }