Hi Kurt,
Actually , it's quite common to have multiple entry and exit points.
Even in C++ if you write Object Code ... your constructors can
be overriden (different entry points ) and any method can exit
anywhere ... If you've only used C++ to code procedural style
this would lead you to think one entry point in and out ...
I don't want to get carried away here ...
regards
SunDog
======================================================
At 11:28 AM 7/12/01 -0400, you wrote:
>Here's a topic for discussion:
>
>Coming from C++-land, I've always been taught over and over again that all
>subroutines/functions/blocks/etc should have only a single entry point and
>a single exit point. "It's just good programming practice." But now in
>the world of Perl, I've observed that a "Perl-ish" thing to do is to place
>multiple return/exit/etc statements in certain blocks of code or in
>conditional blocks. (Then again, maybe it isn't Perl-ish, but I've had to
>sort through many perl scripts like this.)
>
>I guess I'm just curious to know what other more experienced Perl
>programmers think about this. I still adhere strictly to the "one way in,
>one way out" philosophy, mainly for the sake of readability. But I
>understand how much easier it can make a programmer's task to write
>something like "if (some condition) { exit; }"
>
>Also, I was wondering if exiting prematurely like this from a program has
>any adverse affects on the execution of the program.
>
>Thanks,
>Kurt
>