In this chapter, we learnt about object-oriented support in Perl 6. We went through creating a class, adding attributes and methods to it, and making the methods and class data public or private. We then talked about class hierarchy and an alternative approach using roles and also how to use Perl 6 built-in facilities for introspecting the objects. On a set of examples, we examined many techniques of working with complex objects. Finally, the postfix method operators were listed, with which you may create more universal and robust programs.
In the next chapter, exceptions are described. In Perl 6, they are based on classes, so the knowledge from the current chapter will be very useful for better understanding exceptions.