daily pastebin goal
18%
SHARE
TWEET

[Perl 6] Subroutine overloading

cwchen Nov 15th, 2017 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. multi congratulate($name) {
  2.     "Happy birthday, $name".say;
  3. }
  4. multi congratulate($name, $age) {
  5.     "Happy {$age}th birthday, $name".say;
  6. }
  7.  
  8. congratulate('Larry');
  9. congratulate('Bob', 45);
RAW Paste Data
Top