GoodData

Named or positional arguments ?

both with Sub::Params

    use Sub::Params;

    sub foo {
        my %args = Sub::Params::named_or_positional_arguments (
            args => \@_,
            names => [qw[ first second ]],
        );

        return $args{first} + $args{second};
    }

    say foo (1, 2);
    # 3
    say foo (first => 1, second => 2);
    # 3


slide 1/2
* help? contents?

Space, Right Arrow or swipe left to move to next slide, click help below for more details