in reply to BEGIN block and prototyped subroutines
Gives:use warnings; use strict; mysub('duff'); sub mysub() { print "mysub\n" }
But we add the declaration:main::mysub() called too early to check prototype
and we get:use warnings; use strict; sub mysub(); # mysub declaration mysub('duff'); sub mysub() { print "mysub\n" }
as expected.Too many arguments for main::mysub
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: BEGIN block and prototyped subroutines
by hangon (Deacon) on Apr 18, 2010 at 08:12 UTC |