{"id":20160198,"url":"https://github.com/trizen/search-byprefix","last_synced_at":"2026-06-09T10:31:56.670Z","repository":{"id":68776082,"uuid":"64478929","full_name":"trizen/Search-ByPrefix","owner":"trizen","description":"An efficient, tree-based, multi-match prefix searcher.","archived":false,"fork":false,"pushed_at":"2022-01-09T00:32:37.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-03T02:28:33.105Z","etag":null,"topics":["perl","perl-module","perl5"],"latest_commit_sha":null,"homepage":"https://metacpan.org/release/Search-ByPrefix","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trizen.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2016-07-29T12:30:39.000Z","updated_at":"2022-01-09T00:31:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0d95047-ce56-4879-ad09-e62eb1687071","html_url":"https://github.com/trizen/Search-ByPrefix","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/trizen/Search-ByPrefix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trizen%2FSearch-ByPrefix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trizen%2FSearch-ByPrefix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trizen%2FSearch-ByPrefix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trizen%2FSearch-ByPrefix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trizen","download_url":"https://codeload.github.com/trizen/Search-ByPrefix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trizen%2FSearch-ByPrefix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34103355,"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-06-09T02:00:06.510Z","response_time":63,"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":["perl","perl-module","perl5"],"created_at":"2024-11-14T00:12:43.708Z","updated_at":"2026-06-09T10:31:56.648Z","avatar_url":"https://github.com/trizen.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Search::ByPrefix\n\n[Search::ByPrefix](https://metacpan.org/release/Search-ByPrefix) works by creating an internal table from a list of key/value pairs, where each key is an array.\n\nThen, this table can be efficiently searched with an array prefix-key, which finds and returns all the values that have this certain prefix.\n\n```perl\n    use Search::ByPrefix;\n    my $sbp = Search::ByPrefix-\u003enew;\n\n    # Add an entry\n    $sbp-\u003eadd($key, $value);                 # where $key is an array\n\n    # Search by a prefix\n    my @matches = $sbp-\u003esearch($prefix);     # where $prefix is an array\n```\n\nThis example illustrates how to add some key/value pairs to the table and how to search the table with a given prefix:\n\n```perl\n    use 5.010;\n    use Search::ByPrefix;\n    my $obj = Search::ByPrefix-\u003enew;\n\n    sub make_key {\n        [split('/', $_[0])]\n    }\n\n    foreach my $dir (\n                     qw(\n                     /home/user1/tmp/coverage/test\n                     /home/user1/tmp/covert/operator\n                     /home/user1/tmp/coven/members\n                     /home/user2/tmp/coven/members\n                     /home/user1/tmp2/coven/members\n                     )\n      ) {\n        $obj-\u003eadd(make_key($dir), $dir);\n    }\n\n    # Finds the directories that have this common path\n    say for $obj-\u003esearch(make_key('/home/user1/tmp'));\n```\n\nThe results are:\n\n```perl\n    \"/home/user1/tmp/coverage/test\"\n    \"/home/user1/tmp/covert/operator\"\n    \"/home/user1/tmp/coven/members\"\n```\n\n## INSTALLATION\n\nTo install this module, run the following commands:\n\n    perl Makefile.PL\n    make\n    make test\n    make install\n\n## SUPPORT AND DOCUMENTATION\n\nAfter installing, you can find documentation for this module with the\nperldoc command.\n\n    perldoc Search::ByPrefix\n\nYou can also look for information at:\n\n    RT, CPAN's request tracker (report bugs here)\n        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Search-ByPrefix\n\n    AnnoCPAN, Annotated CPAN documentation\n        http://annocpan.org/dist/Search-ByPrefix\n\n    CPAN Ratings\n        http://cpanratings.perl.org/d/Search-ByPrefix\n\n    Search CPAN\n        http://search.cpan.org/dist/Search-ByPrefix/\n\n\n## LICENSE AND COPYRIGHT\n\nCopyright (C) 2016-2022 Daniel Șuteu\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of the the Artistic License (2.0). You may obtain a\ncopy of the full license at:\n\nL\u003chttp://www.perlfoundation.org/artistic_license_2_0\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrizen%2Fsearch-byprefix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrizen%2Fsearch-byprefix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrizen%2Fsearch-byprefix/lists"}