Perl-Apollo / Corinna

Corinna - Bring Modern OO to the Core of Perl
Artistic License 2.0
156 stars 19 forks source link

Clean up example code. #43

Closed druud closed 2 years ago

druud commented 2 years ago

In 5.2.1 there is this example:

my @args = ... get list passed to new()
  unless ( !( @args % 2 ) ) {
    croak("even-sized list required");
}

which at least needs a ';' and a '#' and an indent-correction.

Straight rewrite:

my @args = ...;  # get list passed to new()
unless ( !( @args % 2 ) ) {
    croak("even-sized list required");
}

Alternative:

my @args = ...;  # get list passed to new()
@args % 2 and croak "even-sized list required";
Ovid commented 2 years ago

Thanks, druud! I'm happy to fix this, but if you want to issue a PR and be one of the contributors, I'd be happy to accept it :)

Ovid commented 2 years ago

This has been fixed. Thank you!