Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
t
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Build Status

NAME

Trait::IO - Helper IO traits

SYNOPSIS

    use Trait::IO;

    for <a b c> {
        my $fh does auto-close = .IO.open: :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".IO.open: :w;
    # ...

DESCRIPTION

Useful traits for working with Perl 6 IO.

EXPORTS

does auto-close

my $fh does auto-close = "foo".IO.open: :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.


REPOSITORY

Fork this module on GitHub: https://github.com/zoffixznet/perl6-Trait-IO

BUGS

To report bugs or request features, please use https://github.com/zoffixznet/perl6-Trait-IO/issues

AUTHOR

Zoffix Znet (https://perl6.party/)

LICENSE

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.

About

Raku module: Helper IO traits

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%
You can’t perform that action at this time.