Result:
found more than 820 distributions - search limited to the first 2001 files matching your query ( run in 0.925 )


CGI-Scriptpaths

 view release on metacpan or  search on metacpan

lib/CGI/Scriptpaths.pm  view on Meta::CPAN

may warn and return undef

=head2 DOCUMENT_ROOT()

assumes this is a website and returns document root
if $ENV{DOCUMENT_ROOT} is not set, it tries to test and guess for it
on failure returns undef

=head2 script_rel_path()

returns script's relative path to DOCUMENT_ROOT()

 view all matches for this distribution


CGI-Session-Driver-dbic

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN

    if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
        require Config;
        print
"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";

        # make an educated guess of whether we'll need root permission.
        print "    (You may need to do that as the 'root' user.)\n"
          if eval '$>';
    }
    print "*** $class configuration finished.\n";

inc/Module/AutoInstall.pm  view on Meta::CPAN

              or _load('CPANPLUS::Shell::Default')
        )
    );
}

# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
    require Cwd;
    require File::Spec;

    my $cwd  = File::Spec->canonpath( Cwd::cwd() );

 view all matches for this distribution


CGI-Session

 view release on metacpan or  search on metacpan

lib/CGI/Session/Tutorial.pm  view on Meta::CPAN


Query string is a string appended to URL following a question mark (?) such as:

    http://my.dot.com/login.cgi?user=sherzodr;password=top-secret

As you probably guessed, it can also help you pass state information from a click to another, but how secure is it do you think, considering these URLs tend to get cached by most of the user agents and also logged in the servers access log, to which ...

=head2 HIDDEN FIELDS

Hidden field is another alternative to using query strings and they come in two flavors: hidden fields used in POST methods and the ones in GET. The ones used in GET methods will turn into a true query strings once submitted, so all the disadvantages...

lib/CGI/Session/Tutorial.pm  view on Meta::CPAN


This concludes our discussion of CGI::Session programming style. The rest of the manual covers some L<"SECURITY"> issues. Driver specs from the previous manual were moved to L<CGI::Session::Driver|CGI::Session::Driver>.

=head1 SECURITY

"How secure is using CGI::Session?", "Can others hack down people's sessions using another browser if they can get the session id of the user?", "Are the session ids easy to guess?" are the questions I find myself answering over and over again.

=head2 STORAGE

Security of the library does in many aspects depend on the implementation. After making use of this library, you no longer have to send all the information to the user's cookie except for the session id. But, you still have to store the data in the s...

lib/CGI/Session/Tutorial.pm  view on Meta::CPAN


=back

=head2 SESSION IDs

Session ids are not easily guessed (unless you're using L<incr ID generator|CGI::Session::ID::incr>)! Default configuration of CGI::Session uses L<Digest::MD5|CGI::Session::ID::md5> to generate random, 32 character long identifier. Although this stri...

Consider the scenario, where you just give someone either via email or an instant messaging a link to a Web site where you're currently logged in. The URL you give to that person contains a session id as part of a query string. If the site was initia...

Even if you're solely using cookies as the session id transporters, it's not that difficult to plant a cookie in the cookie file with the same id and trick the web browser to send that particular session id to the server. So key for security is to ch...

 view all matches for this distribution


CGI-Simple

 view release on metacpan or  search on metacpan

lib/CGI/Simple.pm  view on Meta::CPAN

    last READ unless _internal_read( $self, $handle, my $buffer );
    $data .= $buffer;
    $got_data += length $buffer;

    unless ( $boundary ) {
      # If we're going to guess the boundary we need a complete line.
      next READ unless $data =~ /^(.*)$CRLF/o;
      $boundary = $1;

      # Still no boundary? Give up...
      unless ( $boundary ) {

 view all matches for this distribution


CHI-Driver-HandlerSocket

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN

    if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
        require Config;
        print
"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";

        # make an educated guess of whether we'll need root permission.
        print "    (You may need to do that as the 'root' user.)\n"
          if eval '$>';
    }
    print "*** $class configuration finished.\n";

inc/Module/AutoInstall.pm  view on Meta::CPAN

              or _load('CPANPLUS::Shell::Default')
        )
    );
}

# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
    require Cwd;
    require File::Spec;

    my $cwd  = File::Spec->canonpath( Cwd::cwd() );

 view all matches for this distribution


CHI-Driver-MemcachedFast

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN

    if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
        require Config;
        print
"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";

        # make an educated guess of whether we'll need root permission.
        print "    (You may need to do that as the 'root' user.)\n"
          if eval '$>';
    }
    print "*** $class configuration finished.\n";

inc/Module/AutoInstall.pm  view on Meta::CPAN

              or _load('CPANPLUS::Shell::Default')
        )
    );
}

# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
    require Cwd;
    require File::Spec;

    my $cwd  = File::Spec->canonpath( Cwd::cwd() );

 view all matches for this distribution


CHI-Driver-Ping

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN

    if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
        require Config;
        print
"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";

        # make an educated guess of whether we'll need root permission.
        print "    (You may need to do that as the 'root' user.)\n"
          if eval '$>';
    }
    print "*** $class configuration finished.\n";

inc/Module/AutoInstall.pm  view on Meta::CPAN

              or _load('CPANPLUS::Shell::Default')
        )
    );
}

# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
    require Cwd;
    require File::Spec;

    my $cwd  = File::Spec->canonpath( Cwd::cwd() );

 view all matches for this distribution


CHI

 view release on metacpan or  search on metacpan

lib/CHI.pm  view on Meta::CPAN

    purge
    remove

The following methods return information solely from the primary cache.
However, you are free to call them explicitly on the subcache. (Trying to merge
in subcache information automatically would require too much guessing about the
caller's intent.)

    get_keys
    get_namespaces
    get_object

 view all matches for this distribution


CIAO-Lib-Param

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

                    print "It may very well be supported all the way back to ",
                          format_version(5.003_07), ".\n";
                }
                else {
                    print "But given the things $f depends on, it's a good",
                          " guess that it isn't\n",
                          "supported prior to ", format_version($todo), ".\n";
                }
            }
        }
    }

ppport.h  view on Meta::CPAN


#ifndef IVSIZE
#  ifdef LONGSIZE
#    define IVSIZE LONGSIZE
#  else
#    define IVSIZE 4 /* A bold guess, but the best we can make. */
#  endif
#endif
#ifndef UVTYPE
#  define UVTYPE                         unsigned IVTYPE
#endif

 view all matches for this distribution


CIAO-Lib-StackIO

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

 * capable of those should have IVSIZE already. */
#if !defined(IVSIZE) && defined(LONGSIZE)
#   define IVSIZE LONGSIZE
#endif
#ifndef IVSIZE
#   define IVSIZE 4 /* A bold guess, but the best we can make. */
#endif

#ifndef UVSIZE
#   define UVSIZE IVSIZE
#endif

 view all matches for this distribution


CIPP

 view release on metacpan or  search on metacpan

lib/CIPP/Manual.pm  view on Meta::CPAN


=over 8

=item B<NAME>

This is the name of the module you want to use. Nested module names are delimited by ::. This is exactly what the Perl use pragma expects (you guessed right, CIPP simply translates <?USE> to use :-).

It is not possible to use a variable or expression for NAME, you must always use a literal string here.

=back

 view all matches for this distribution


CLI-Meta-YoutubeDl

 view release on metacpan or  search on metacpan

devdata/youtube-dl.help.2015.02.23.1  view on Meta::CPAN

    --abort-on-error                 Abort downloading of further videos (in the playlist or the command line) if an error occurs
    --dump-user-agent                display the current browser identification
    --list-extractors                List all supported extractors and the URLs they would handle
    --extractor-descriptions         Output descriptions of all supported extractors
    --default-search PREFIX          Use this prefix for unqualified URLs. For example "gvsearch2:" downloads two videos from google videos for  youtube-dl "large apple". Use the value "auto"
                                     to let youtube-dl guess ("auto_warning" to emit a warning when guessing). "error" just throws an error. The default value "fixup_error" repairs broken
                                     URLs, but emits an error if this is not possible instead of searching.
    --ignore-config                  Do not read configuration files. When given in the global configuration file /etc/youtube-dl.conf: Do not read the user configuration in ~/.config
                                     /youtube-dl/config (%APPDATA%/youtube-dl/config.txt on Windows)
    --flat-playlist                  Do not extract the videos of a playlist, only list them.
    --no-color                       Do not emit color codes in output.

 view all matches for this distribution


CLI-Meta-YtDlp

 view release on metacpan or  search on metacpan

devdata/youtube-dl.help.2015.02.23.1  view on Meta::CPAN

    --abort-on-error                 Abort downloading of further videos (in the playlist or the command line) if an error occurs
    --dump-user-agent                display the current browser identification
    --list-extractors                List all supported extractors and the URLs they would handle
    --extractor-descriptions         Output descriptions of all supported extractors
    --default-search PREFIX          Use this prefix for unqualified URLs. For example "gvsearch2:" downloads two videos from google videos for  youtube-dl "large apple". Use the value "auto"
                                     to let youtube-dl guess ("auto_warning" to emit a warning when guessing). "error" just throws an error. The default value "fixup_error" repairs broken
                                     URLs, but emits an error if this is not possible instead of searching.
    --ignore-config                  Do not read configuration files. When given in the global configuration file /etc/youtube-dl.conf: Do not read the user configuration in ~/.config
                                     /youtube-dl/config (%APPDATA%/youtube-dl/config.txt on Windows)
    --flat-playlist                  Do not extract the videos of a playlist, only list them.
    --no-color                       Do not emit color codes in output.

 view all matches for this distribution


CLI-Popt

 view release on metacpan or  search on metacpan

easyxs/ppport.h  view on Meta::CPAN

                    print "It may very well be supported all the way back to ",
                          format_version(5.003_07), ".\n";
                }
                else {
                    print "But given the things $f depends on, it's a good",
                          " guess that it isn't\n",
                          "supported prior to ", format_version($todo), ".\n";
                }
            }
        }
    }

easyxs/ppport.h  view on Meta::CPAN


#ifndef IVSIZE
#  ifdef LONGSIZE
#    define IVSIZE LONGSIZE
#  else
#    define IVSIZE 4 /* A bold guess, but the best we can make. */
#  endif
#endif
#ifndef UVTYPE
#  define UVTYPE                         unsigned IVTYPE
#endif

 view all matches for this distribution


CMS-MediaWiki

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN


#ifndef IVSIZE
#  ifdef LONGSIZE
#    define IVSIZE LONGSIZE
#  else
#    define IVSIZE 4 /* A bold guess, but the best we can make. */
#  endif
#endif
#ifndef UVTYPE
#  define UVTYPE                         unsigned IVTYPE
#endif

 view all matches for this distribution


CORBA-IDLtree

 view release on metacpan or  search on metacpan

lib/CORBA/IDLtree.pm  view on Meta::CPAN

#                     input file:
#                     - Add `use utf8`.
#                     - Require module Encode::Guess.
#                     - In sub get_items:
#                       - On encountering a non printable character call
#                         Encode::Guess->guess.
#                       - If the call returns a ref then a decoder was found
#                         and no special action is required.
#                       - If the call returns "No appropriate encodings found"
#                         then assign $l from Encode::decode("cp-1252", $l).
#                       - If the call returns none of the above then print a

lib/CORBA/IDLtree.pm  view on Meta::CPAN

        if ($firstline) {
            $l = discard_bom($l);
            $firstline = 0;
        }
        if ($l =~ /[^\t\f[:print:]]/) {
            my $decoder = Encode::Guess->guess($l);
            unless (ref $decoder) {
                # info($decoder);
                if ($decoder =~ /No appropriate encodings found/) {
                    $l = Encode::decode("cp-1252", $l);
                } else {

 view all matches for this distribution


CORBA-MICO

 view release on metacpan or  search on metacpan

README.win32  view on Meta::CPAN


The win32 build procedure for MICO Perl interface tries to stick as closely
as possible to the general build procedure of most CPAN modules, ie. the
same used for building CORBA::MICO on Unix systems.

One difference however is guessing the location of MICO's header- and
compiled library files, which are required for compiling CORBA::MICO.
In contrast to Unix, there is no "standard" location for those files on
win32 systems (like /lib, /usr/lib, /usr/include, etc.)

Therefore you have to specify the location of your win32 build of MICO

 view all matches for this distribution


CORBA-omniORB

 view release on metacpan or  search on metacpan

README.win32  view on Meta::CPAN

The win32 build procedure for the omniORB Perl interface tries to
stick as closely as possible to the general build procedure of most
CPAN modules, i.e., the same used for building CORBA::omniORB on Unix
systems.

One difference, however, is the method used for guessing the location
of omniORB's header- and compiled library files, which are required
for compiling CORBA::omniORB, since there is no pkg-config database
available on Win32. Therefore, you have to specify the location of
your win32 build of omniORB in a separate configuration file
(CONFIG.win32)

 view all matches for this distribution


CPAN-CachingProxy

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

1.6500: Fri Jan 20 2012
   - added support for http ranges from rfc2616§14

1.6000: Tue Jan 03 2012
   - Nobody really uses this but me I guess; otherwise someone
     surely would have noticed the various timing problems with
     the cache by now.

     I have resolved them with lockfiles (for now).  I haven't
     thought of a better solution, and I think this will work

 view all matches for this distribution


CPAN-Changes

 view release on metacpan or  search on metacpan

bin/tidy_changelog  view on Meta::CPAN

$opt{token} ||= qr/\{\{\$NEXT\}\}/;

my $changelog = shift;

unless ( $changelog ) {
    # try to guess it
    opendir my $dir, '.';
    my @files = grep { -f $_ and /^change/i } readdir $dir;
    die "changelog not provided and couldn't be guessed\n"
        unless @files == 1;

    $changelog = shift @files;
    warn "changelog not provided, guessing '$changelog'\n\n";
}

if ($opt{check}) {
    require Test::CPAN::Changes;
    require Test::More;

 view all matches for this distribution


CPAN-DistnameInfo

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


  * Normalize dist() for CGI.pm [Michael G. Schwern]

0.08 -- Wed May  6 09:21:47 CDT 2009

  * make a better guess at the meaning of Dist-Name-undef.tar.gz
  * add tests for the .tar.bz2 feature added in 0.07

0.07 -- Mon Jun 30 09:27:04 CDT 2008

  * Added support for .tar.bz2 archive extension

 view all matches for this distribution


CPAN-FindDependencies

 view release on metacpan or  search on metacpan

bin/cpandeps-diff  view on Meta::CPAN

If you don't provide a command then it will generate a report about all known
modules.

=head2 help

Can you guess what this does?

=head1 ARGUMENTS

=head2 perl $version

 view all matches for this distribution


CPAN-Info-FromRepoName

 view release on metacpan or  search on metacpan

lib/CPAN/Info/FromRepoName.pm  view on Meta::CPAN

    $mod;
}

$SPEC{extract_cpan_info_from_repo_name} = {
    v => 1.1,
    summary => 'Extract/guess information from a repo name',
    description => <<'_',

Guess information from a repo name and return a hash (or undef if nothing can be
guessed). Possible keys include `dist` (Perl distribution name).

_
    args => {
        repo_name => {
            schema => 'str*',

lib/CPAN/Info/FromRepoName.pm  view on Meta::CPAN

    }
    $res;
}

1;
# ABSTRACT: Extract/guess information from a repo name

__END__

=pod

=encoding UTF-8

=head1 NAME

CPAN::Info::FromRepoName - Extract/guess information from a repo name

=head1 VERSION

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

lib/CPAN/Info/FromRepoName.pm  view on Meta::CPAN


Usage:

 extract_cpan_info_from_repo_name($repo_name) -> hash

ExtractE<sol>guess information from a repo name.

Examples:

=over

lib/CPAN/Info/FromRepoName.pm  view on Meta::CPAN

 extract_cpan_info_from_repo_name("\@foo"); # -> undef

=back

Guess information from a repo name and return a hash (or undef if nothing can be
guessed). Possible keys include C<dist> (Perl distribution name).

This function is not exported by default, but exportable.

Arguments ('*' denotes required arguments):

 view all matches for this distribution


CPAN-Info-FromURL

 view release on metacpan or  search on metacpan

lib/CPAN/Info/FromURL.pm  view on Meta::CPAN

    $mod;
}

$SPEC{extract_cpan_info_from_url} = {
    v => 1.1,
    summary => 'Extract/guess information from a URL',
    description => <<'_',

Return a hash of information from a CPAN-related URL. Possible keys include:
`site` (site nickname, include: `mcpan` [metacpan.org, api.metacpan.org,
fastapi.metacpan.org], `sco` [search.cpan.org], `cpanratings`

lib/CPAN/Info/FromURL.pm  view on Meta::CPAN

    }
    $res;
}

1;
# ABSTRACT: Extract/guess information from a URL

__END__

=pod

=encoding UTF-8

=head1 NAME

CPAN::Info::FromURL - Extract/guess information from a URL

=head1 VERSION

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

lib/CPAN/Info/FromURL.pm  view on Meta::CPAN


Usage:

 extract_cpan_info_from_url($url) -> hash

ExtractE<sol>guess information from a URL.

Examples:

=over

 view all matches for this distribution


CPAN-Maker

 view release on metacpan or  search on metacpan

lib/CPAN/Maker.pm  view on Meta::CPAN

it will be assumed the Perl modules and artifacts to be packaged are
somewhere to be found in the project tree (as described in your
buildspec file). You should make sure that you set the C<path> section
accordingly so that the utility knows were to find your Perl modules.

I<I'm actually not sure how useful this feature is. I'm guessing that
the scenario for use might be if you have the buildspec file somewhere
other than the repo you wish to build or you don't own or don't want
to fork a project but want to build a CPAN distribution from it?>

=item description

 view all matches for this distribution


CPAN-Meta

 view release on metacpan or  search on metacpan

lib/CPAN/Meta.pm  view on Meta::CPAN

#pod =method load_string
#pod
#pod   my $meta = CPAN::Meta->load_string($string, \%options);
#pod
#pod If you don't know if a string contains YAML or JSON, this method will use
#pod L<Parse::CPAN::Meta> to guess.  In other respects it is identical to
#pod C<load_file()>.
#pod
#pod =cut

sub load_string {

lib/CPAN/Meta.pm  view on Meta::CPAN

=head2 load_string

  my $meta = CPAN::Meta->load_string($string, \%options);

If you don't know if a string contains YAML or JSON, this method will use
L<Parse::CPAN::Meta> to guess.  In other respects it is identical to
C<load_file()>.

=head2 save

  $meta->save($distmeta_file, \%options);

 view all matches for this distribution


CPAN-Metadata-RDF

 view release on metacpan or  search on metacpan

lib/CPAN/Metadata/RDF.pm  view on Meta::CPAN

# Creator: author name / email address
# Subject: the thing in the =name
# Description: synopsis
# Contributor: co-maintainers
# Source: ?
# Language: can we guess language?
# Relation:
# Coverage:
# Rights: license from meta.yml?

      $self->insert($identifier, "$CPANNS/suffix", $suffix);

 view all matches for this distribution


CPAN-Mini-Inject-REST

 view release on metacpan or  search on metacpan

inc/Module/AutoInstall.pm  view on Meta::CPAN

    if ( @Missing and not( $CheckOnly or $UnderCPAN ) ) {
        require Config;
        print
"*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";

        # make an educated guess of whether we'll need root permission.
        print "    (You may need to do that as the 'root' user.)\n"
          if eval '$>';
    }
    print "*** $class configuration finished.\n";

inc/Module/AutoInstall.pm  view on Meta::CPAN

              or _load('CPANPLUS::Shell::Default')
        )
    );
}

# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
    require Cwd;
    require File::Spec;

    my $cwd  = File::Spec->canonpath( Cwd::cwd() );

 view all matches for this distribution


CPAN-Mini-Inject

 view release on metacpan or  search on metacpan

lib/CPAN/Mini/Inject.pm  view on Meta::CPAN

    unless -w $self->config->get( 'repository' );

  croak "$0: cannot read module file: $options{file}"
   unless -r $options{file};

  # attempt to guess module and version
  my $distmeta = Dist::Metadata->new( file => $options{file} );

  my $packages = $distmeta->package_versions;
  # include passed in module and version (prefer the declared version)
  if ( $options{module} and $options{version} ) {

 view all matches for this distribution


CPAN

 view release on metacpan or  search on metacpan

lib/App/Cpan.pm  view on Meta::CPAN


	r =>  [ \&_recompile,         NO_ARGS, GOOD_EXIT, 'Recompiling'                  ],
	u =>  [ \&_upgrade,           NO_ARGS, GOOD_EXIT, 'Running `make test`'          ],
	's' => [ \&_shell,            NO_ARGS, GOOD_EXIT, 'Drop into the CPAN.pm shell'  ],

	'x' => [ \&_guess_namespace,     ARGS, GOOD_EXIT, 'Guessing namespaces'          ],
	c =>  [ \&_default,              ARGS, GOOD_EXIT, 'Running `make clean`'         ],
	f =>  [ \&_default,              ARGS, GOOD_EXIT, 'Installing with force'        ],
	i =>  [ \&_default,              ARGS, GOOD_EXIT, 'Running `make install`'       ],
	'm' => [ \&_default,             ARGS, GOOD_EXIT, 'Running `make`'               ],
	t =>  [ \&_default,              ARGS, GOOD_EXIT, 'Running `make test`'          ],

lib/App/Cpan.pm  view on Meta::CPAN

		};

	# How do I handle exit codes for multiple arguments?
	my @errors = ();

	$options->{x} or _disable_guessers();

	foreach my $arg ( @$args )
		{
		# check the argument and perhaps capture typos
		my $module = _expand_module( $arg ) or do {

lib/App/Cpan.pm  view on Meta::CPAN

			grep { int }
			sort { length $a <=> length $b }
				length($module)/4, 4
			)[0];

		my $guesses = _guess_at_module_name( $module, $threshold );
		if( defined $guesses and @$guesses ) {
			$logger->info( "Perhaps you meant one of these:" );
			foreach my $guess ( @$guesses ) {
				$logger->info( "\t$guess" );
				}
			}
		return;
		}

	return $expanded;
	}

my $guessers = [
	[ qw( Text::Levenshtein::XS distance 7 1 ) ],
	[ qw( Text::Levenshtein::Damerau::XS     xs_edistance 7 1 ) ],

	[ qw( Text::Levenshtein     distance 7 1 ) ],
	[ qw( Text::Levenshtein::Damerau::PP     pp_edistance 7 1 ) ],

	];

sub _disable_guessers
	{
	$_->[-1] = 0 for @$guessers;
	}

# for -x
sub _guess_namespace
	{
	my $args = shift;

	foreach my $arg ( @$args )
		{
		$logger->debug( "Checking $arg" );
		my $guesses = _guess_at_module_name( $arg );

		foreach my $guess ( @$guesses ) {
			print $guess, "\n";
			}
		}

	return HEY_IT_WORKED;
	}

lib/App/Cpan.pm  view on Meta::CPAN

	}

BEGIN {
my $distance;
my $_threshold;
my $can_guess;
my $shown_help = 0;
sub _guess_at_module_name
	{
	my( $target, $threshold ) = @_;

	unless( defined $distance ) {
		foreach my $try ( @$guessers ) {
			$can_guess = eval "require $try->[0]; 1" or next;

			$try->[-1] or next; # disabled
			no strict 'refs';
			$distance = \&{ join "::", @$try[0,1] };
			$threshold ||= $try->[2];

lib/App/Cpan.pm  view on Meta::CPAN

		}
	$_threshold ||= $threshold;

	unless( $distance ) {
		unless( $shown_help ) {
			my $modules = join ", ", map { $_->[0] } @$guessers;
			substr $modules, rindex( $modules, ',' ), 1, ', and';

			# Should this be colorized?
			if( $can_guess ) {
				$logger->info( "I can suggest names if you provide the -x option on invocation." );
				}
			else {
				$logger->info( "I can suggest names if you install one of $modules" );
				$logger->info( "and you provide the -x option on invocation." );

lib/App/Cpan.pm  view on Meta::CPAN

		}

	my $modules = _get_all_namespaces();
	$logger->info( "Checking " . @$modules . " namespaces for close match suggestions" );

	my %guesses;
	foreach my $guess ( @$modules ) {
		my $distance = $distance->( $target, $guess );
		next if $distance > $_threshold;
		$guesses{$guess} = $distance;
		}

	my @guesses = sort { $guesses{$a} <=> $guesses{$b} } keys %guesses;
	return [ grep { defined } @guesses[0..9] ];
	}
}

1;

 view all matches for this distribution


( run in 0.925 second using v1.01-cache-2.11-cpan-702932259ff )