Data-Structure-Deserialize-Auto
view release on metacpan or search on metacpan
lib/Data/Structure/Deserialize/Auto.pm view on Meta::CPAN
127128129130131132133134135136137138139140141142143144145146147
$v
= io->file(
$v
)->slurp;
}
unshift
(
@decoders
,
$hint
)
if
(
defined
(
$hint
));
my
$n
;
do
{
$n
=
shift
(
@decoders
);
my
$decoder
=
$decoders
{
$n
};
try
{
my
$structure
=
$decoder
->(
$v
);
if
(
ref
(
$structure
) eq
'HASH'
||
ref
(
$structure
) eq
'ARRAY'
) {
# warn("decoded using '$n'");
return
$decoder
->(
$v
);
}
}
catch
{
# ignore any errors and try the next decoder, or die out at the bottom
};
}
while
(
@decoders
);
die
(
"Data::Structure::Deserialize::Auto was unable to process the input"
);
}
=pod
( run in 0.232 second using v1.01-cache-2.11-cpan-ec4f86ec37b )