Subject: | Anonymous methods without semicolon |
I was surprised when anonymous methods worked! But they need a
semicolon at the end. It would be nice if that wasn't necessary.
Here's a test.
#!/usr/bin/perl -w
use strict;
use warnings;
use Test::More 'no_plan';
{
package Stuff;
use Test::More;
use Method::Signatures;
method echo($arg) {
return $arg
}
my $method = method ($arg) {
return $self->echo($arg)
}
is( Stuff->$method("foo"), "foo" );
}