Subject: | magical variable $. treated as undef |
Dump() incorrectly treats $. as undef. Here is a quick example :
use strict;
use warnings;
use YAML::Syck;
my @lines;
open my $fh, "<", $0 or die $!;
while (<$fh>) {
push @lines, {bad_num => $., good_num => $.+0, line => $_};
}
print Dump(\@lines);
__END__
Output :
---
-
bad_num: ~
good_num: '1'
line: "use strict;\n"
-
bad_num: ~
good_num: '2'
line: "use warnings;\n"
<etc.>