cwchen icon

[Perl 6] Creating a subroutine with default values

cwchen | PRO | 11/16/17 02:57:07 AM UTC | 0 ⭐ | 8440 👁️ | Never ⏰ | []
Perl 6 |

0 B

|

None

|

0 👍

/

0 👎

sub hello($name = "World") {
    "Hello {$name}".say;
}
 
hello();
hello("Michael");

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎