{"id":15557721,"url":"https://github.com/fgasper/p5-call-context","last_synced_at":"2025-07-13T18:39:55.451Z","repository":{"id":56837124,"uuid":"73578837","full_name":"FGasper/p5-Call-Context","owner":"FGasper","description":"CPAN’s Call::Context module","archived":false,"fork":false,"pushed_at":"2024-04-24T13:10:29.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T21:08:05.460Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FGasper.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-11-12T21:14:30.000Z","updated_at":"2024-04-24T13:10:31.000Z","dependencies_parsed_at":"2024-06-19T10:00:26.602Z","dependency_job_id":"7748bc41-e696-460e-a001-47237a90f1e3","html_url":"https://github.com/FGasper/p5-Call-Context","commit_stats":{"total_commits":16,"total_committers":3,"mean_commits":5.333333333333333,"dds":0.125,"last_synced_commit":"e62824fb0c95591fde70f73ce0ff030daf78f83c"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/FGasper/p5-Call-Context","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fp5-Call-Context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fp5-Call-Context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fp5-Call-Context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fp5-Call-Context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FGasper","download_url":"https://codeload.github.com/FGasper/p5-Call-Context/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FGasper%2Fp5-Call-Context/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265188946,"owners_count":23725184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-02T15:20:28.337Z","updated_at":"2025-07-13T18:39:55.430Z","avatar_url":"https://github.com/FGasper.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nCall::Context - Sanity-check calling context\n\n# SYNOPSIS\n\n    use Call::Context;\n\n    sub gives_a_list {\n\n        # Will die() if the context is not list.\n        Call::Context::must_be_list();\n\n        return (1, 2, 3);\n    }\n\n    gives_a_list();             # die()s: incorrect context (void)\n\n    my $v = gives_a_list();     # die()s: incorrect context (scalar)\n\n    my @list = gives_a_list();  # lives\n\n    #----------------------------------------------------------------------\n\n    sub scalar_is_bad {\n\n        # Will die() if the context is scalar.\n        Call::Context::must_not_be_scalar();\n\n        return (1, 2, 3);\n    }\n\n    scalar_is_bad();            # die()s: incorrect context (void)\n\n    my $v = scalar_is_bad();    # die()s: incorrect context (scalar)\n\n    my @list = scalar_is_bad(); # lives\n\n# DESCRIPTION\n\nIf your function only expects to return a list, then a call in some other\ncontext is, by definition, an error. The problem is that, depending on how\nthe function is written, it may actually do something expected in testing, but\nthen in production act differently.\n\n# FUNCTIONS\n\n## must\\_be\\_list()\n\n`die()`s if the calling function is itself called outside list context.\n(See the SYNOPSIS for examples.)\n\n## must\\_not\\_be\\_scalar()\n\n`die()`s if the calling function is itself called in scalar context.\n(See the SYNOPSIS for examples.)\n\n# EXCEPTIONS\n\nThis module throws instances of `Call::Context::X`. `Call::Context::X` is\noverloaded to stringify; however, to keep memory usage low, `overload` is not\nloaded until instantiation.\n\n# REPOSITORY\n\nhttps://github.com/FGasper/p5-Call-Context\n\n# LICENSE\n\nThis module is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgasper%2Fp5-call-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffgasper%2Fp5-call-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgasper%2Fp5-call-context/lists"}