Subject: | Can't load file if filename is an object |
The patch below fixes the issue. Basically, with 0.61, one can't use
LoadFile($filename) if $filename is a blessed object with
stringification overloaded. (as happens with Catalyst.)
The patch is very basic; another approach would be for example to use
Scalar::Util::reftype() instead of ref().
diff -du -r1.1 lib/YAML.pm
--- lib/YAML.pm 2006/07/03 12:19:13 1.1
+++ lib/YAML.pm 2006/07/03 12:19:28
@@ -44,7 +44,7 @@
sub DumpFile {
my $OUT;
my $filename = shift;
- if (ref $filename) {
+ if (ref $filename eq 'GLOB') {
$OUT = $filename;
}
else {
@@ -62,7 +62,7 @@
sub LoadFile {
my $IN;
my $filename = shift;
- if (ref $filename) {
+ if (ref $filename eq 'GLOB') {
$IN = $filename;
}
else {
End of patch.