NAME

CPAN::Release::FromURL - Extract CPAN release (tarball) name from a URL

VERSION

This document describes version 0.092 of CPAN::Release::FromURL (from Perl distribution CPAN-Info-FromURL), released on 2020-10-02.

FUNCTIONS

extract_cpan_release_from_url

Usage:

 extract_cpan_release_from_url($url) -> str

Extract CPAN release (tarball) name from a URL.

Examples:

  • Example #1 (mcpan/pod/MOD):

     extract_cpan_release_from_url("https://metacpan.org/pod/Foo::Bar"); # -> undef
  • Example #2 (mcpan/pod/release/AUTHOR/DIST-VERSION/lib/MOD.pm):

     extract_cpan_release_from_url("http://metacpan.org/pod/release/SRI/Mojolicious-6.46/lib/Mojo.pm"); # -> undef
  • Example #3 (cpan/authors/id/A/AU/AUTHOR/DIST-VER.tar.gz):

     extract_cpan_release_from_url("file:/cpan/authors/id/S/SR/SRI/Mojolicious-6.46.tar.gz");

    Result:

     "Mojolicious-6.46.tar.gz"
  • Example #4 (unknown):

     extract_cpan_release_from_url("https://www.google.com/"); # -> undef

This function is not exported by default, but exportable.

Arguments ('*' denotes required arguments):

  • $url* => str

Return value: (str)

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/CPAN-Info-FromURL.

SOURCE

Source repository is at https://github.com/perlancar/perl-CPAN-Info-FromURL.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=CPAN-Info-FromURL

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

CPAN::Info::FromURL, the more generic module which is used by this module.

CPAN::Author::FromURL

CPAN::Dist::FromURL

CPAN::Module::FromURL

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2020, 2018, 2017, 2016 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.