Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use FindBin instead of awk to find the path to utils.pm #1241

Closed
wants to merge 2 commits into from
Closed

Conversation

evgeni
Copy link
Contributor

@evgeni evgeni commented Feb 26, 2014

'use lib utils.pm' is not valid Perl syntax:

Bareword "utils" not allowed while "strict subs" in use at plugins-scripts/check_ircd.pl line 52.
Bareword "pm" not allowed while "strict subs" in use at plugins-scripts/check_ircd.pl line 52.

This makes it impossible to use the plugins directly from the git tree, e.g. while hacking on them.

Using FindBin::Bin as the library path allows that, while preserving the original behaviour of adding the libexec path when the plugin is properly installed.

'use lib utils.pm' is not valid Perl syntax:
 Bareword "utils" not allowed while "strict subs" in use at plugins-scripts/check_ircd.pl line 52.
 Bareword "pm" not allowed while "strict subs" in use at plugins-scripts/check_ircd.pl line 52.

This makes it impossible to use the plugins directly from the git tree,
e.g. while hacking on them.

Using FindBin::Bin as the library path allows that, while preserving
the original behaviour of adding the libexec path when the plugin is
properly installed.
@evgeni
Copy link
Contributor Author

evgeni commented Feb 26, 2014

Thinking further, the following can now be removed from subst.in:

# add to libexecdir to INC for perl utils.pm
/^use/ { if (/lib/) { if (/utils.pm|"."/ ) {sub(/utils.pm|"."/,led() )} } }

Removing this would stop new contributions from accidentally using it again.

The whole led() function could be then removed too.

Edit: done so in fc542ce after talking to @waja on IRC.

It was only used to replace the 'use lib utils.pm' with the proper
libexec dir, which is now solved by using Perl's FinBin.
@waja waja closed this in 2d49468 Feb 27, 2014
mat813 pushed a commit to Absolight/monitoring-plugins that referenced this pull request Sep 13, 2017
It was only used to replace the 'use lib utils.pm' with the proper
libexec dir, which is now solved by using Perl's FinBin.

Closes monitoring-plugins#1241
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant