[BristolBathPM] Code competition - let's try something new
Lyle
webmaster at cosmicperl.com
Sun Jan 11 00:24:01 GMT 2009
Alex Francis wrote:
> On Wed, Jan 7, 2009 at 11:13 PM, Lyle <webmaster at cosmicperl.com> wrote:
>
>> ...
>> Creating nasty looking dumps like:-
>>
>> $var->{array}->[0]->{key} = 'value';
>> $var->{array}->[0]->{array2}->[0] = 'one';
>>
>
> Might I ask what for?
>
> It seems my colleagues are favouring JSON instead of Data::Dumper at the moment.
>
Thought the popular thing these days was YAML? Not that I've used either
myself...
An example of the use would be dumping out the same variable with
variations to two separate files that are later required in.
With a normal data dumper, you'd have to require one file, rename the
variable, require the next, then merge.
Whereas if the dump has one value per line, like in my previous example,
simply requiring in the two dumped files will give you a single merged
variable.
I'm trying to avoid the normal load config -> parse it into variables
approach. For a quicker load straight into variables...
Lyle
More information about the BristolBathPM
mailing list