Can't call method "first" on unblessed reference at ./perldoc-browser.pl line 47.
Closed this issue · 5 comments
I cloned the program to play with it. cd
to the local repo root and run the program which resulted in the mentioned error.
$ ./perldoc-browser.pl
Can't call method "first" on unblessed reference at ./perldoc-browser.pl line 47.
I looked at the source and found that the root cause is on line 21:
my $perls_dir = path(app->config->{perls_dir}
missing configuration.
README states:
Perldoc Browser is configured by perldoc-browser.conf in the application directory.
The file is not there, neither I see it on GitHub
Where is perldoc-browser.conf?
Now I have to go through the code to figure out how the configuration file should look like.
Can we have an example configuration file?
May be the sqlite
feature can be made mandatory or default or may be the perls
directory can be guessed on first run and used. For example I use perlbrew
and by running which perl
I get
$ which perl
/home/berov/perl5/perlbrew/perls/perl-5.26.1/bin/perl
This is a common case.
I will definitely add an example configuration file, I forgot to before. I haven't decided yet how to handle trying to run the browser without installing or configuring any perls first.
The initial error you ran into is because of a mistake in assigning the default on line 26.
to run the browser without installing or configuring any perls first.
May be the perl
with which the browser is run can be used as default source (almost what I suggest with my PR) for the documentation.
It is now very rare the case people to use the standard /usr/bin/perl
(coming with a distribution) for development purposes.