Perl will only execute subroutines when called.  It is recommended that you
group all subroutine defintions either at the beginning or the end of the
program.

Pat

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 29, 2002 1:38 PM
To: [EMAIL PROTECTED]
Subject: Question on PERL coding style...



This might be a really strange question, but I need to ask -

Does PERL execute from beginning through the program in a linear fashion,
"jumping around" subroutines unless they're called?
I have a program that's structured as shown below (assume vars and
statements are different) and need to know if as it executes the subroutine
is executed "inline" or only when it's called and the "flow" of the program
goes around it until it hits the call at the end.
Thanks!

$var = something
$var = something
$var = something
$var = something
statememt
if test
        $var = something
        statement
end if
Subroutine "zort"
{
        $var = something
        statement
        $var = something
        statement
        $var = something
        statement
}
$var = something
statement
$var = something
statement
subroutine call of subroutine "zort"

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to