in reply to Re: How to get code from a coderef?
in thread How to get code from a coderef?

What is YAML's behavior? I'd imagine that YAML shouldn't even attempt to touch them because code references aren't portable to the other platforms YAML is supposed to work in. YAML is a data format, not a perl dumper.

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Replies are listed 'Best First'.
Re^3: How to get code from a coderef?
by diego_de_lima (Beadle) on Jan 20, 2006 at 21:41 UTC
    YAML actually uses B::Deparse to dump. Remember the way back of YAML is much slower and unsafe than having a coderef on a perl script. Diego de Lima

      If a compiled perl serializes to perl source code, is compiled C# or whatver supposed to serialize to C# source code as well? What is supposed to happen when restoring something dumped like this? Is perl supposed to compile the code? Are other languages supposed to compile their code? What is supposed to happen when trading YAML between environments? YAML is a portable format so I don't understand what it means when language specific things are folded into it. That's contrary to the point of YAML, isn't it?

      ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊