in reply to Converting from Storable to YAML
Better still is to use JSON::XS.
use strict; use warnings; use JSON::XS; my $hash {}; ... fill up the hashref with stuff ... my $json = JSON::XS->new()->pretty(); my $json_text = $json->encode($hash); open(my $ofh, '>', $outfilename); print $ofh $json_text; close $ofh;
The stored format in the file is quite readable, and JSON::XS is uber-fast when compared to YAML and Storable.
What can be asserted without proof can be dismissed without proof. - Christopher Hitchens
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Converting from Storable to YAML
by moritz (Cardinal) on Jan 21, 2011 at 21:57 UTC | |
Re^2: Converting from Storable to YAML
by Your Mother (Archbishop) on Jan 21, 2011 at 21:48 UTC |
In Section
Seekers of Perl Wisdom