NAME

App::CPAN::Get::Utils - Utilities for App::CPAN::Get.

SYNOPSIS

use App::CPAN::Get::Utils qw(process_module_name_and_version);

my ($module_name, $module_version_range) = process_module_name_and_version($module_string);

SUBROUTINES

process_module_name_and_version

my ($module_name, $module_version_range) = process_module_name_and_version($module_string);

Process module name string.

Returns array with module name and module version range strings.

EXAMPLE

use strict;
use warnings;

use App::CPAN::Get::Utils qw(process_module_name_and_version);

if (@ARGV < 1) {
        print STDERR "Usage: $0 module_name[\@module_version]\n";
        exit 1;
}
my $module_name_and_version = $ARGV[0];

my ($module_name, $module_version_range) = process_module_name_and_version($module_name_and_version);

print "Module string from input: $module_name_and_version\n";
print "Module name: $module_name\n";
if (defined $module_version_range) {
        print "Module version range: $module_version_range\n";
}

# Output for 'Module':
# Module string from input: Module
# Module name: Module

# Output for 'Module@1.23':
# Module string from input: Module@1.23
# Module name: Module
# Module version range: == 1.23

DEPENDENCIES

Exporter, Readonly.

REPOSITORY

https://github.com/michal-josef-spacek/App-CPAN-Get

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© 2021-2024 Michal Josef Špaček

BSD 2-Clause License

VERSION

0.12