Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: YAML::Syck and blessed references of scalars

by ferreira (Chaplain)
on Mar 23, 2007 at 10:54 UTC ( [id://606201]=note: print w/replies, xml ) Need Help??


in reply to YAML::Syck and blessed references of scalars

Unlike Khen1950fx, I don't expect the syntax for tagged data types to be considered simple. As a matter of fact, YAML::Tiny croaks "YAML::Tiny does not support explicit tags" if you feed them to the module

There might be some bug in YAML::Syck which is preventing your case to work (!var foo), in contrast to (!var [foo]). Because

pirl $> YAML::Syck::Load "--- !!perl/array:var [foo]\n" # long tags $var = bless( [ 'foo' ], 'var' ); pirl $> YAML::Syck::Load "--- !var [foo]\n" # short tags $var = bless( [ 'foo' ], 'var' );
should work just like
pirl $> YAML::Syck::Load "--- !!perl/scalar:var foo\n" # long tags, ok +! $var = bless( do{\(my $o = 'foo')}, 'var' ); pirl $> YAML::Syck::Load "--- !var foo\n" # short tags, :( $var = 'foo';
which it doesn't.

Replies are listed 'Best First'.
Re^2: YAML::Syck and blessed references of scalars
by dgaramond2 (Monk) on Mar 23, 2007 at 11:55 UTC
    Ah, it's a bug then. Submitted to RT. I'll be using the long tag version for now, hoping that YAML::Syck will be fixed soon to support the short version. Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://606201]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-20 00:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found