class Foo; has $.x; say Foo.new(:x<42>).yaml # --- !pugs/object:Foo # x: 42
To deserialize, use the eval $str :lang<yaml> builtin. (Despite its name this does not run arbitrary code.)
In reply to Re: YAML & Objects
by gaal
in thread YAML & Objects
by pileofrogs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |