Avoid applying a regex to all lines of the format; find the first
Format-Version: and use it. [There should only ever be one Format-Version:
anyway.]
local $_;
while (<$status_fh>) {
chomp;
push @lines, $_;
local $_;
while (<$status_fh>) {
chomp;
push @lines, $_;
- $version = $1 if /^Format-Version: ([0-9]+)/i;
+ if (not defined $version and
+ /^Format-Version: ([0-9]+)/i
+ ) {
+ $version = $1;
+ }
+ $version = 2 if not defined $version;
# Version 3 is the latest format version currently supported.
if ($version > 3) {
warn "Unsupported status version '$version'";
# Version 3 is the latest format version currently supported.
if ($version > 3) {
warn "Unsupported status version '$version'";