--- name: compile-time syntax errors --- # Compile-time syntax errors Errors the parser raises before the program runs. A compile-time error stops the whole program: nothing executes, because the source could not be turned into runnable ops. Unlike runtime `die`s, these are not trappable with `eval BLOCK` - but a string `eval` of source that fails to compile reports them through `$@`: ```perl my $code = '1 +'; eval $code; warn "compile failed: $@" if $@; ``` ## Subroutine resolution at compile time ### `` `Undefined subroutine &%s` `` **(F)** The parser resolved a call to a named subroutine that does not exist at compile time. This is the compile-time companion to the runtime [`Undefined subroutine &%s called`](fatal-general) error: the difference is *when* the missing sub is noticed. Make sure the defining module is `use`d, and that the name is spelled correctly and fully qualified where the package matters. ## See also - [General fatal errors](fatal-general) - the runtime form of the undefined-subroutine error. - [Subroutines](../perlsub) - declaration, prototypes, and the rules that decide when a call resolves. - [`use`](../perlfunc/use) - pulls in the module that defines the subroutine, at compile time.