Bart Lateur <[EMAIL PROTECTED]> writes:

> The place where it would be put, would be irrelevant.
> 
>         sub readit {
>           POST {
>               close F;
>           }
>             open F, "< $f" ...
>             scalar(<F>)
>         }

Would the POST be executed if the open fails? Why? Why not?

       sub readit {
            POST {
                close F;
            }
            open F, "< $f" or die;
            scalar(<F>)
       }

But I think this is getting ridiculous. $slightly_joking++; I'd
propose a much nicer and cleaner concept:

    sub readit {
        open F ... ;
        prog1 {
            scalar(<F>);
            close F;
        }
    }

'prog1' executes all expressions in the block, and returns the result
of the first expression. Of course, we also need prog2, prog3, and so
on ... $slightly_joking--; 

All that POST and such do, is obfuscate the flow of control. I doubt
that outweighs the small benefits.

-- Johan

Reply via email to