use constant { TITLE => 3, RT => 7 }; { # extra block so that $/ retrieve its previous value after reading this file local $/ = ""; # Paragraph mode while (my $record= ) { my @lines = split "\n", $record; $TI = "$1" if $lines[TITLE] =~ /^TITLE=(.*)/; $RT = "$1" if $lines[RT] =~ /^RTINSECONDS=(.*)/; } }