dgaramond2 has asked for the wisdom of the Perl Monks concerning the following question:
I need to load some "named symbols" which I encode in YAML as:
!var [foo]
which in Perl becomes (bless ['foo'], 'var'), which will be reblessed into the "real" Perl class for later processing. Since these named symbols will be mentioned a lot, I wonder if I can use a simpler syntax like:
!var foo
which can become (bless(do{\(my $o = 'fooz')}, 'var')). Currently YAML::Syck simply load the above as scalars, while Ruby's YAML.rb does interpret this.
Any ideas of simpler syntaxes for my named symbols?
Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: YAML::Syck and blessed references of scalars
by ferreira (Chaplain) on Mar 23, 2007 at 10:54 UTC | |
by dgaramond2 (Monk) on Mar 23, 2007 at 11:55 UTC | |
|
Re: YAML::Syck and blessed references of scalars
by Khen1950fx (Canon) on Mar 23, 2007 at 06:16 UTC |