NAME

CPAN::Module::FromURL - Extract/guess CPAN module from a URL

VERSION

This document describes version 0.090 of CPAN::Module::FromURL (from Perl distribution CPAN-Info-FromURL), released on 2018-12-30.

FUNCTIONS

extract_cpan_module_from_url

Usage:

 extract_cpan_module_from_url($url) -> str

Extract/guess CPAN module from a URL.

Examples:

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

     extract_cpan_module_from_url("https://metacpan.org/pod/Foo::Bar"); # -> "Foo::Bar"
  • Example #2 (mcpan/release/DIST):

     extract_cpan_module_from_url("https://metacpan.org/release/Foo-Bar"); # -> "Foo::Bar"
  • Example #3 (sco/search?module):

     extract_cpan_module_from_url("http://search.cpan.org/search?module=ToolSet"); # -> "ToolSet"
  • Example #4 (mojo):

     extract_cpan_module_from_url("https://mojolicious.org/perldoc/Mojo/DOM/CSS"); # -> "Mojo::DOM::CSS"
  • Example #5 (unknown):

     extract_cpan_module_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::Release::FromURL

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 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.