Subject: | config_file() method: its documentation is at variance with the way it is used |
While doing further exploration of another RT for this distribution
(https://rt.cpan.org/Ticket/Display.html?id=55272), I installed the most
recent version of CPAN-Mini on a different box. Inside the
read_config() method, I see that the config_file() method is called like
this:
sub read_config {
my ($class, $options) = @_;
my $config_file = $class->config_file($options);
...
}
So it's called in scalar context, which makes sense. When I look at the
code for config_file(), I see that the method returns a scalar if the
config file is found and an empty list if it doesn't:
sub config_file {
my ($class, $options) = @_;
...
return (
(defined $config_file && -e $config_file)
? $config_file
: ()
);
}
However, the *documentation* for config_file() suggests that the method
returns a *hash*:
config_file
my %config = CPAN::Mini->config_file( { options } );
This is confusing.
Thank you very much.
Jim Keenan