Clean

NAME

Clean - Scoped object oriented automatic cleanup

SYNOPSIS

use v6;
    use Clean;
class Foo does Cleanable {
      method clean {
        say "clean called!";
      }
    }
clean Foo.new, -> $o { say $o.perl if $o.defined; }

DESCRIPTION

Provides a routine `clean` that takes an object and an anonymous code block which takes an object that does `Cleanable`. This basically ensures that your objects can be cleaned after your code block has finished running. Thus it provides an object-oriented `clean` method (aka destructor).

AUTHOR

Ahmad M. Zawawi, azawawi

LICENSE

MIT License

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.