diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Parse/CPAN/Meta.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Parse/CPAN/Meta.pm | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Master/tlpkg/tlperl/lib/Parse/CPAN/Meta.pm b/Master/tlpkg/tlperl/lib/Parse/CPAN/Meta.pm index f7d717cdb1d..04ac3e16a1d 100644 --- a/Master/tlpkg/tlperl/lib/Parse/CPAN/Meta.pm +++ b/Master/tlpkg/tlperl/lib/Parse/CPAN/Meta.pm @@ -5,7 +5,7 @@ use Carp 'croak'; # UTF Support? sub HAVE_UTF8 () { $] >= 5.007003 } -sub IO_LAYER () { $] >= 5.008001 ? ":utf8" : "" } +sub IO_LAYER () { $] >= 5.008001 ? ":utf8" : "" } BEGIN { if ( HAVE_UTF8 ) { @@ -17,7 +17,7 @@ BEGIN { # Class structure require 5.004; require Exporter; - $Parse::CPAN::Meta::VERSION = '1.4401'; + $Parse::CPAN::Meta::VERSION = '1.4402'; @Parse::CPAN::Meta::ISA = qw{ Exporter }; @Parse::CPAN::Meta::EXPORT_OK = qw{ Load LoadFile }; } @@ -40,7 +40,7 @@ sub load_yaml_string { my ($class, $string) = @_; my $backend = $class->yaml_backend(); my $data = eval { no strict 'refs'; &{"$backend\::Load"}($string) }; - if ( $@ ) { + if ( $@ ) { croak $backend->can('errstr') ? $backend->errstr : $@ } return $data || {}; # in case document was valid but empty @@ -88,7 +88,7 @@ sub _slurp { or die "can't open $_[0] for reading: $!"; return do { local $/; <$fh> }; } - + sub _can_load { my ($module, $version) = @_; (my $file = $module) =~ s{::}{/}g; @@ -133,21 +133,21 @@ Parse::CPAN::Meta - Parse META.yml and META.json CPAN metadata files ############################################# # In your file - + --- name: My-Distribution version: 1.23 resources: homepage: "http://example.com/dist/My-Distribution" - - + + ############################################# # In your program - + use Parse::CPAN::Meta; - + my $distmeta = Parse::CPAN::Meta->load_file('META.yml'); - + # Reading properties my $name = $distmeta->{name}; my $version = $distmeta->{version}; @@ -196,7 +196,7 @@ C<load_yaml_string>. my $metadata_structure = Parse::CPAN::Meta->load_json_string($json_string); -This method deserializes the given string of JSON and the result. +This method deserializes the given string of JSON and the result. If the source was UTF-8 encoded, the string must be decoded before calling C<load_json_string>. |