#!/usr/bin/env /friends/.rakudobrew/bin/perl6 my &fizz = { $^n % 3 ?? $^n !! 'Fizz' }; my &buzz = { $^n % 5 ?? $^n !! 'Buzz' }; sub fizzbuzz($f, $b){ $f ~~ Int ?? $b ~~ Int ?? $f !! $b !! $b ~~ Int ?? $f !! $f~$b; } sub infix:($f,$b){ fizzbuzz($f,$b) } say fizz(1) ! buzz(1); say fizz(3) ! buzz(3); say fizz(5) ! buzz(5); say fizz(15) ! buzz(15); #say (1..15).map({fizz($_)}) >>!<< (1..15).map({buzz($_)});