in reply to Re: Detecting undefined subroutines at compile time
in thread Detecting undefined subroutines at compile time

It seems like Perl can detect undefined subroutines at compile time..

Nope, that's still runtime.

use strict; use warnings; print "hello world\n"; foo();

Output

$perl func.pl hello world Undefined subroutine &main::foo called at func.pl line 6.

I'm not sure how big of a problem this really is. This is why you make test scripts and actually verify your code. But I also wish I knew a solution for this issue as well.

Replies are listed 'Best First'.
Re^3: Detecting undefined subroutines at compile time
by toolic (Bishop) on May 02, 2011 at 17:52 UTC
    This is why you make test scripts and actually verify your code.
    I did make a test script and ran it to verify my code, as I clearly demonstrated. My problem was that my test was invalid due to my ignorance in the distinction between compile-time and runtime in this instance (also clearly demonstrated:). I'm here to learn, and I learn by making mistakes (sometimes in public).