Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Named optional parameters

use v5.44;
no warnings "experimental::signature_named_parameters";

sub run(:$cmd, :$hostname = "localhost") {
    say "Running '$cmd' on '$hostname'";
}

run(cmd => "ls");
run(cmd => "cat", hostname => "animals.com");
run(hostname => "animals.com", cmd => "dog");