Show quoted text> Not anymore. YAML::Syck used to be trying to be perl 5.3 compatible,
> it's now 5.6 compatible. and 5.6 had the better 3 arg open().
>
> I'd be happy to apply a patch for this, see the boring form letter
> below:
The patch to lib is in gihub and attached. As I'm UTF8 ignorant, I can't provide a test to prove
this works as expected, but I see no reason considering the scope of the patch.
commit 7721be078c8d5df9dc480b1d9dc928b9cb635acc
Author: Todd Rinaldo <toddr@cpan.org>
Date: Thu Jul 15 14:34:09 2010 -0500
RT 48327 - use 3 arg form of open() instead of the 2 argument form
diff --git a/lib/JSON/Syck.pm b/lib/JSON/Syck.pm
index 8aa196e..f0af51e 100644
--- a/lib/JSON/Syck.pm
+++ b/lib/JSON/Syck.pm
@@ -19,7 +19,7 @@ sub DumpFile {
}
else {
local *FH;
- open FH, "> $file" or die "Cannot write to $file: $!";
+ open(FH, '>', $file) or die "Cannot write to $file: $!";
print FH YAML::Syck::DumpJSON($_[0]);
close FH;
}
@@ -33,7 +33,7 @@ sub LoadFile {
}
else {
local *FH;
- open FH, "< $file" or die "Cannot read from $file: $!";
+ open(FH, '<', $file) or die "Cannot read from $file: $!";
YAML::Syck::LoadJSON(do { local $/; <FH> });
}
}
diff --git a/lib/YAML/Syck.pm b/lib/YAML/Syck.pm
index 449d5da..f934388 100644
--- a/lib/YAML/Syck.pm
+++ b/lib/YAML/Syck.pm
@@ -105,7 +105,7 @@ sub DumpFile {
}
else {
local *FH;
- open FH, "> $file" or die "Cannot write to $file: $!";
+ open(FH, '>', $file) or die "Cannot write to $file: $!";
if ($#_) {
print FH YAML::Syck::DumpYAML($_) for @_;
}
@@ -124,7 +124,7 @@ sub LoadFile {
}
else {
local *FH;
- open FH, "< $file" or die "Cannot read from $file: $!";
+ open(FH, '<', $file) or die "Cannot read from $file: $!";
Load(do { local $/; <FH> });
}
}