Perl 6 module: Helper IO traits
Switch branches/tags
Nothing to show
Latest commit c2400fa Jun 12, 2017 @zoffixznet committed on GitHub Create META6.json
Failed to load latest commit information.
lib/Trait first commit Apr 29, 2017
logotype Revert "Revert "Fix logotype size"" May 5, 2017
t first commit Apr 29, 2017
.gitignore first commit Apr 29, 2017
.travis.yml Death to panda Apr 29, 2017
LICENSE first commit Apr 29, 2017
META6.json Create META6.json Jun 12, 2017 Update Apr 29, 2017

Build Status


Trait::IO - Helper IO traits


    use Trait::IO;

    for <a b c> {
        my $fh does auto-close = :w;
        # ... do things with the file handle
        # $fh is auto-closed on block leave
    # Top-level is OK too; will close on scope leave
    my $fh does auto-close = "foo" :w;
    # ...


Useful traits for working with Perl 6 IO.


does auto-close

my $fh does auto-close = "foo" :w;

Installs a LEAVE phaser to automatically close the file handle when scope is left.

Exports the auto-close constant and the trait_mod:<does> multi that accepts it as a value.

Currently works only with variables and not with attributes or parameters. Patches welcome.


Fork this module on GitHub:


To report bugs or request features, please use


Zoffix Znet (


You can use and distribute this module under the terms of the The Artistic License 2.0. See the LICENSE file included in this distribution for complete details.