while (<>){ # Read the each record and return one whole record $entry = SWISS::Entry->fromText($_); my @lines = split /\n/; # Now each element of @line is one "line" from the # block just read in. The last element is //. }