Data-Structure-Deserialize-Auto

 view release on metacpan or  search on metacpan

lib/Data/Structure/Deserialize/Auto.pm  view on Meta::CPAN

    $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.372 second using v1.01-cache-2.11-cpan-26ccb49234f )