my $object_size = length $contents;
my ($start, $length);
- if ($1 ne "") {
+ if (defined($1)) {
($start, $length) = ($2 + 0, $3 + 0);
} else {
($start, $length) = (0, $3 + 0);
# Try to parse the data as "key: value" pairs of file metadata. Also
# handle continuation lines, which start with whitespace and continue
# the previous "key: value" pair.
- if ($line =~ m/^(\w+):\s*(.*)$/) {
+ if ($line =~ m/^([-\w]+):\s*(.*)$/) {
$info{$1} = $2;
$last_key = $1;
} elsif ($line =~/^\s/ && defined $last_key) {
# lines.
chomp $line;
- if ($line =~ m/^(\w+):\s*(.*)$/) {
+ if ($line =~ m/^([-\w]+):\s*(.*)$/) {
$descriptor{$1} = $2;
$last_key = $1;
} elsif ($line =~/^\s/ && defined $last_key) {