Ethereal-dev: Re: [Ethereal-dev] Lua: where to find V2P.pm

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

Date: Wed, 22 Feb 2006 22:47:13 +0100
On 2/22/06, Joerg Mayer <jmayer@xxxxxxxxx> wrote:
> On Wed, Feb 22, 2006 at 05:56:09PM +0100, LEGO wrote:
> > If you want it, I checked it in a while ago in trunk/tools/tpg as I
> > used it for the parser.
>
> Ahh, and I ignored all the google hits pointing to Ethereal ;-)
> I just created a softlink and now it works.

BTW you could just have commented out the "use V2P;" line it's not
used any more... I used it to print out the hash of hashes of arrays
and arrays of hashes arround which elua_makedoc.pl works.

Just for the mention, I wrote the toy (V2P)  some years ago while
trying to mesh up a complex network so that it would be resilient to
more than one failure at once. Oddly enough turned out not to be
really useful as circular references would make it to smash the stack.

use V2P;
$r = { a=> [1,2,3,4], b=> {1=>[4,5,6], 2=> {a=>1,b=>2}}};
print var2perl($r)

yields valid perl code to restate the same variable

{
 'a' =>[
   1,
   2,
   3,
   4
  ],
 'b' =>{
   1 =>[
    4,
    5,
    6
   ],
   2 =>{
    'a' =>1,
    'b' =>2
   }

  }

}

This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan