Last active
October 14, 2025 00:13
-
-
Save LiosK/acef3b100a7096f8f9c7b0d1c98cf9c8 to your computer and use it in GitHub Desktop.
Install Perl modules in macOS system Perl without cluttering /usr/local
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -x | |
| # Install Perl modules in macOS system Perl without cluttering /usr/local | |
| # Prerequisite | |
| xcode-select --install | |
| # Install modules locally | |
| sysperl=/usr/bin/perl | |
| FQ_LOAD_QUOTELET=-defaults curl -L https://cpanmin.us/ | \ | |
| $sysperl - -n --local-lib=~/.sys_perl5 \ | |
| JSON::Parse https://github.com/LiosK/Finance--Quote--YahooJapan.git | |
| # NOTE: persist these env vars to have sysperl and FQ load local libs and YahooJapan | |
| export PERL5LIB="$HOME/.sys_perl5/lib/perl5" | |
| export FQ_LOAD_QUOTELET='-defaults YahooJapan' | |
| # Test | |
| $sysperl -e 'print "$_\n" for @INC;' | |
| $sysperl ~/.sys_perl5/bin/fetch_quotes_from_yahoo_japan.pl |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivations:
cpan --sudo module_nameputs some script and document files under /usr/local, which conflict with Homebrew Perl