{"id":28256130,"url":"https://github.com/davorg/perl5lib_auto","last_synced_at":"2026-07-08T12:31:02.948Z","repository":{"id":293284069,"uuid":"983547949","full_name":"davorg/perl5lib_auto","owner":"davorg","description":"A Bash script that automatically sets the `PERL5LIB` environment variable when you `cd` into a directory containing a Perl project.","archived":false,"fork":false,"pushed_at":"2026-04-19T11:29:20.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-05T15:52:10.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-14T14:43:39.000Z","updated_at":"2026-04-19T11:29:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"88a5ac52-e21f-42a0-b193-80a799c85eb5","html_url":"https://github.com/davorg/perl5lib_auto","commit_stats":null,"previous_names":["davorg/perl5lib_auto"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davorg/perl5lib_auto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davorg%2Fperl5lib_auto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davorg%2Fperl5lib_auto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davorg%2Fperl5lib_auto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davorg%2Fperl5lib_auto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davorg","download_url":"https://codeload.github.com/davorg/perl5lib_auto/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davorg%2Fperl5lib_auto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35265380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-19T22:15:50.244Z","updated_at":"2026-07-08T12:31:02.941Z","avatar_url":"https://github.com/davorg.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# perl5lib_auto.sh\n\nA Bash script that automatically sets the `PERL5LIB` environment variable when you `cd` into a directory containing a Perl project.\n\nIt scans for `lib/` directories containing `.pm` files, applies intelligent exclusions and limits, and sets or appends to `PERL5LIB` accordingly.\n\n## ✅ Features\n\n- Recursively scans for `lib/` directories under the current directory\n- Includes only those containing `.pm` files\n- Excludes common build/IDE directories and versioned-release folders\n- Skips scanning when inside specific top-level directories (like `~/git`)\n- Optionally limits how many `lib/` directories to include\n- Supports dry-run mode and verbose debugging\n- All behaviour is configurable via environment variables\n\n## 🔄 Installation\n\nSave the script somewhere convenient, for example:\n\n```bash\nmkdir -p ~/bin\ncurl -o ~/bin/perl5lib_auto.sh https://raw.githubusercontent.com/davorg/perl5lib_auto/main/perl5lib_auto.sh\nchmod +x ~/bin/perl5lib_auto.sh\n```\n\nThen source it in your `~/.bashrc` or `~/.bash_profile`:\n\n```bash\nsource ~/bin/perl5lib_auto.sh\n```\n\nOpen a new terminal or run `source ~/.bashrc` to activate it.\n\n## 🌍 Environment Variables\n\nYou can customise the script’s behaviour with the following environment variables:\n\n| Variable                     | Description                                                                 |\n|-----------------------------|-----------------------------------------------------------------------------|\n| `PERL5LIB_LIB_CAP`          | Max number of `lib/` dirs to include (default: `3`)                         |\n| `PERL5LIB_FORCE`            | Set to `1` to override exclusions and cap                                   |\n| `PERL5LIB_APPEND`           | Set to `1` to append to existing `PERL5LIB` rather than overwrite           |\n| `PERL5LIB_VERBOSE`          | Set to `1` for debug output                                                 |\n| `PERL5LIB_DRYRUN`           | Set to `1` to preview `PERL5LIB` without actually setting it                |\n| `PERL5LIB_EXCLUDE_DIRS`     | Colon-separated absolute directory paths to skip entirely (default: `~:~/git`) |\n| `PERL5LIB_EXCLUDE_PATTERNS` | Colon-separated substrings to filter out of matched `lib/` paths (default: `.vscode:blib`) |\n\n## 🧪 Example Usage\n\n```bash\nPERL5LIB_VERBOSE=1 cd ~/projects/MyApp            # Show matched lib dirs\nPERL5LIB_DRYRUN=1 cd ~/projects/MyApp             # Preview what would happen\nPERL5LIB_FORCE=1 cd ~/git                         # Force scanning even if excluded\nPERL5LIB_LIB_CAP=5 cd ~/src/BigProject            # Temporarily increase cap\n```\n\n## 🧼 Example Defaults\n\nBy default, the script behaves as if the following were set:\n\n```bash\nexport PERL5LIB_LIB_CAP=3\nexport PERL5LIB_EXCLUDE_DIRS=\"$HOME:$HOME/git\"\nexport PERL5LIB_EXCLUDE_PATTERNS=\".vscode:blib\"\n```\n\n## 📜 License\n\nMIT or similar — feel free to adapt for your own shell environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavorg%2Fperl5lib_auto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavorg%2Fperl5lib_auto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavorg%2Fperl5lib_auto/lists"}