{"id":20315234,"url":"https://github.com/sysread/filter-cleanup","last_synced_at":"2026-04-15T23:33:30.694Z","repository":{"id":3455427,"uuid":"4509197","full_name":"sysread/Filter-Cleanup","owner":"sysread","description":"A flat, stackable error handler for Perl.","archived":false,"fork":false,"pushed_at":"2017-10-30T17:56:38.000Z","size":17,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T07:26:29.079Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sysread.png","metadata":{"files":{"readme":"README.pod","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-31T15:11:48.000Z","updated_at":"2017-10-30T16:20:56.000Z","dependencies_parsed_at":"2022-09-08T12:31:06.833Z","dependency_job_id":null,"html_url":"https://github.com/sysread/Filter-Cleanup","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sysread/Filter-Cleanup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2FFilter-Cleanup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2FFilter-Cleanup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2FFilter-Cleanup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2FFilter-Cleanup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysread","download_url":"https://codeload.github.com/sysread/Filter-Cleanup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysread%2FFilter-Cleanup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27446446,"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","status":"online","status_checked_at":"2025-12-02T02:00:06.387Z","response_time":54,"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":"2024-11-14T18:18:24.449Z","updated_at":"2025-12-02T05:12:30.719Z","avatar_url":"https://github.com/sysread.png","language":"Perl","readme":"=pod\n\n=encoding UTF-8\n\n=head1 NAME\n\nFilter::Cleanup - Execute cleanup statements when scope closes, regardless of errors\n\n=head1 VERSION\n\nversion 0.03\n\n=head1 SYNOPSIS\n\n  use Filter::Cleanup;\n\n  open my $fh, $file_path or die $!;\n  cleanup { close $fh };\n  do_risky_stuff_with_fh($fh);\n\n=head1 DESCRIPTION\n\nDefines a block of code to be evaluated once the current scope has completed\nexecution. If an error is thrown during the execution of statements after the\nC\u003ccleanup\u003e block, the error is trapped and rethrown after the C\u003ccleanup\u003e block\nis executed.\n\n=head1 NAME\n\nFilter::Cleanup\n\n=head1 CAVEATS\n\n=head2 ORDERING OF CLEANUP BLOCKS\n\nA cleanup block will execute ahead of any cleanups defined before it. That is,\nfor a given scope, cleanup blocks will be called in the opposite order in which\nthey were declared.\n\n=head2 IMPLEMENTATION\n\nThis module was originally implemented as a source filter (hence the name), but\nnow uses L\u003cKeyword::Declare\u003e.\n\n=head1 SEE ALSO\n\n=head2 Guard\n\nL\u003cGuard\u003e is implemented in XS and attaches a code block to the actual stack\nframe, ensuring it is executed regardless of how the scope was exited. In many\ncases, this may be preferable to the behavior of C\u003cFilter::Cleanup\u003e, which will\nnot be executed if the block calls C\u003cexit\u003e or C\u003cgoto\u003e (note that C\u003clast\u003e I\u003cis\u003e\nhandled correctly).\n\n=head1 AUTHOR\n\nJeff Ober L\u003csysread@fastmail.fm\u003e\n\n=head1 LICENSE\n\nPerl5\n\n=head1 AUTHOR\n\nJeff Ober \u003csysread@fastmail.fm\u003e\n\n=head1 COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2017 by Jeff Ober.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n\n=cut\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysread%2Ffilter-cleanup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysread%2Ffilter-cleanup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysread%2Ffilter-cleanup/lists"}