in reply to Re: DANGER - was Re: Re: Syntax Error Checking
in thread Syntax Error Checking
we'd get the barney subroutine defined, with no connection (except closures if any) with the fred subroutine. Invoking fred would do nothing to or about barney. Replace barney with BEGIN, and you get the same behavior with respect to fred, except that BEGIN is now executed immediately even before compiling foo foo. Drop the "sub" keyword, and the same behavior applies.sub fred { blah blah; sub barney { print "hey there"; } foo foo; }
-- Randal L. Schwartz, Perl hacker
|
---|