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: 105
Status: resolved
Priority: 0/
Queue: YAML

People
Owner: Nobody in particular
Requestors: jduncan [...] fotnago.com
Cc:
AdminCc:

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



Subject: YAML doesn't serialize odd objects very well
YAML.pm doesn't serialize objects other than hashes or array. Best displayed with the following script: use YAML; use Data::Dumper; use FileHandle; use URI; use CGI; my $d = { fh => FileHandle->new( ">/tmp/$$" ), uri => URI->new( "http://localhost/" ), p => { names => ['james','alexander','duncan'], }, cgi => CGI->new(), arr => MyObj::Class->new() }; $d->{a} = $d->{p}->{names}; my $y = Store( $d ); print $y; print Dumper( Load( $y ) ); print Dumper( $d ); $d->{fh}->close(); unlink("/tmp/$$"); package MyObj::Class; sub new { return bless ['one','two','three'], $_[0]; }
This email should be jduncan@fotango.com... [JDUNCAN - Thu Dec 20 05:33:42 2001]: Show quoted text
> YAML.pm doesn't serialize objects other than hashes or array. Best > displayed with the following script: > > use YAML; > use Data::Dumper; > use FileHandle; > use URI; > use CGI; > > my $d = { > fh => FileHandle->new( ">/tmp/$$" ), > uri => URI->new( "http://localhost/" ), > p => { > names => ['james','alexander','duncan'], > }, > cgi => CGI->new(), > arr => MyObj::Class->new() > }; > > $d->{a} = $d->{p}->{names}; > > my $y = Store( $d ); > print $y; > print Dumper( Load( $y ) ); > print Dumper( $d ); > > > $d->{fh}->close(); > unlink("/tmp/$$"); > > package MyObj::Class; > > sub new { > return bless ['one','two','three'], $_[0]; > } > > >
Date: Thu, 20 Dec 2001 13:34:22 -0800
From: Brian Ingerson <ingy [...] ttul.org>
To: James_Duncan via RT <bug-YAML [...] rt.cpan.org>
Subject: Re: [cpan #105] YAML doesn't serialize odd objects very well
Thanks. Will fix. I actually knew about the blessed scalar bug, but decided to get this preliminary release out the door for people to start playing with. I can actually do better than D::D with blessed globs as I can parse a lot of them. Data::Dumper doesn't truly serialize globs. It just creates a string that says "a glob was here." Soon I will even attempt to serialize subroutines (CODE) using B::Deparse. Stay tuned... Thanks again for the report. Cheers, Brian On 20/12/01 05:33 -0500, James_Duncan via RT wrote: Show quoted text
> > > This message about YAML was sent to you by JDUNCAN via rt.cpan.org > > <URL: https://rt.cpan.org/Ticket/Display.html?id=105 > > > YAML.pm doesn't serialize objects other than hashes or array. Best displayed with the following script: > > use YAML; > use Data::Dumper; > use FileHandle; > use URI; > use CGI; > > my $d = { > fh => FileHandle->new( ">/tmp/$$" ), > uri => URI->new( "http://localhost/" ), > p => { > names => ['james','alexander','duncan'], > }, > cgi => CGI->new(), > arr => MyObj::Class->new() > }; > > $d->{a} = $d->{p}->{names}; > > my $y = Store( $d ); > print $y; > print Dumper( Load( $y ) ); > print Dumper( $d ); > > > $d->{fh}->close(); > unlink("/tmp/$$"); > > package MyObj::Class; > > sub new { > return bless ['one','two','three'], $_[0]; > } > >
This issue has been copied to: https://github.com/ingydotnet/yaml-pm/issues/35 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
Looks like this has been fixed long ago. Closing