davebaker has asked for the wisdom of the Perl Monks concerning the following question:
Any solutions to this problem that have arisen since 2006? Yesterday I misspelled a subroutine. My program crashed at runtime. I don't want to write a test that does a "can" on every darned subroutine I call in my program.
I understand why Perl "can't" do this (see thread linked below). But it seems bizarre to me that it "can't" do this because some fairly rare programs dynamically write and name a subroutine. That can't happen very often.
In a world of "use strict" there is no similar pragma for this situation?
https://www.perlmonks.org/?node_id=549550
(Edited 2024-12-16 at 13:39 ET, to specify the desired behavior, as suggested in a comment: I'd like to be able to have an error produced at compile time rather than at run time.)
|
|---|