Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML CPAN distribution.

Report information
The Basics
Id: 20257
Status: resolved
Priority: 0/
Queue: YAML

People
Owner: Nobody in particular
Requestors: RGARCIA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.61
Fixed in: (no value)



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.