in reply to Re: The purpose of prototypes in perl subroutines
in thread The purpose of prototypes in perl subroutines
You can call any subroutine without parentheses as long as it's been "seen" before:
update: Ironically, a nice way to make the above fail is to use a (wrong) protoype:#!/usr/local/bin/perl -w use strict; sub bla { print "Bla!\n"; } bla;
#!/usr/local/bin/perl -w use strict; sub bla($) { print "Bla!\n"; } bla; __END__ syntax error at test.pl line 8, near "bla;" Execution of test.pl aborted due to compilation errors.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: The purpose of prototypes in perl subroutines
by jjhorner (Hermit) on Apr 13, 2005 at 15:32 UTC | |
by Joost (Canon) on Apr 13, 2005 at 15:45 UTC | |
by brian_d_foy (Abbot) on Apr 13, 2005 at 17:36 UTC | |
by jjhorner (Hermit) on Apr 13, 2005 at 17:41 UTC | |
by brian_d_foy (Abbot) on Apr 13, 2005 at 18:12 UTC |