Hi All,
  I've been meaning to write a new data dumper for a while now. One of 
those this that doesn't seem that big so keeps getting put off...

Having recently purchased "Learning Perl/Tk" and "Mastering Perl/Tk" to 
realise that the later isn't a follow on book, but a replacement that 
includes everything from Learning Perl/Tk and a load more. It seems I 
have a spare book...

Putting the two together sounds to me like a quick code competition, to 
the victor a free copy of Learning Perl/Tk! Either sent to your or given 
at the next meet.

Requirements are pretty simple, just dump out a variable, following down 
the levels of anonymous storage just like Data::Dumper does. But rather 
than creating pretty dumps like:-

$var = {
    array =>
    [
        {
            key => 'value',
            array2 =>
            [
                'one', 'two', 'three'
            ]
        }
    ]
};

Creating nasty looking dumps like:-

$var->{array}->[0]->{key} = 'value';
$var->{array}->[0]->{array2}->[0] = 'one';
$var->{array}->[0]->{array2}->[0] = 'two';
$var->{array}->[0]->{array2}->[0] = 'three';

or

$var3->{array}[0]{key} = 'value';
$var3->{array}[0]{array2}[0] = 'one';
$var3->{array}[0]{array2}[1] = 'two';
$var3->{array}[0]{array2}[2] = 'three';


I wonder who can come up with the cleverest and quickest way of doing 
it? (or if anyone tries at all?)


Lyle

_______________________________________________
BristolBathPM mailing list
[email protected]
http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm

Reply via email to