$ perl -le " sub foo { } " $ perl -le " sub foo spaces { } " Illegal declaration of subroutine main::foo at -e line 1. $ perl -le " use diagnostics; sub foo spaces { } " Illegal declaration of subroutine main::foo at -e line 1 (#1) (F) A subroutine was not declared correctly. See perlsub. Uncaught exception from user code: Illegal declaration of subroutine main::foo at -e line 1.