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

Function with signature

use v5.44;

sub area($width, $height) {
    return $width * $height;
}

my $area = area(2, 3);
say $area;

my $too_few = area(2);
say $too_few;

my $too_many = area(2, 5, 11);
say $too_many;

  • Checks that the correct number of parameters is provided.
  • Raises run-time exception.