Prototypes come in action at compile time. When foo('bar') is compiled, the BEGIN block hasn't been seen. Nor has the definition of sub foo.
If you use prototypes, you must make the prototype known before the call to the sub is compiled. Otherwise, the compiler cannot know what to check/how to compile the call.
In reply to Re: BEGIN block and prototyped subroutines
by JavaFan
in thread BEGIN block and prototyped subroutines
by hangon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |