class Dog { has Str $.name; method bark(Int:D $x) { say self.^name; say "bark" for 1..$x; } } Dog.bark(3); --output:-- Dog bark bark bark