diff --git a/lib/Plack/Builder.pm b/lib/Plack/Builder.pm index 5156166d..9b4d44ee 100644 --- a/lib/Plack/Builder.pm +++ b/lib/Plack/Builder.pm @@ -109,9 +109,13 @@ sub builder(&) { $urlmap; }; local $_add = sub { + defined wantarray + and Carp::carp("WARNING: You used enable() in non-void context"); $self->add_middleware(@_); }; local $_add_if = sub { + defined wantarray + and Carp::carp("WARNING: You used enable_if() in non-void context"); $self->add_middleware_if(@_); };