CC: | garfieldnate [...] gmail.com |
Subject: | Subroutine not filtered if no space between name and curly brace |
This became a very difficult to track down bug in a Test::Base::Filter method. Below is a script to demonstrate the bug. According to the documentation, each method should print 'Foo', and I should not have to get $self myself. However, the methods with no space between the name and the curly brace are apparently not filtered.
package MyTest;
use 5.010;
my $test = SpiffTest->new();
my $foo = Foo->new();
$test->working($foo);
$test->not_working($foo);
$test->working_again($foo);
package Foo;
sub new {
return bless [], shift;
}
package SpiffTest;
use Spiffy -Base;
sub working {
my ($arg) = @_;
say 'working: ' . ref $arg;
}
sub not_working{
my ($arg) = @_;
say 'not working: ' . ref $arg;
}
sub working_again{
my ($self, $arg) = @_;
say 'working again: ' . ref $arg;
}