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
- Re: assign to magic name-of-function variable instead... Edward Peschko
- Re: assign to magic name-of-function variable instead... Glenn Linderman
- Re: assign to magic name-of-function variable instead... Johan Vromans
- Re: assign to magic name-of-function variable instead of &... abigail
- Re: assign to magic name-of-function variable instead of &... James Mastros
- Re: assign to magic name-of-function variable instead of &... John Porter
- Re: assign to magic name-of-function variable instead of &... Tony Olekshy
- Re: assign to magic name-of-function variable instead... Glenn Linderman
- Re: assign to magic name-of-function variable instead of &... Bart Lateur
- Re: assign to magic name-of-function variable instead of &... Johan Vromans
- Re: assign to magic name-of-function variable instead... John Porter
- Re: assign to magic name-of-function variable instead... Ariel Scolnicov
- Re: assign to magic name-of-function variable instead of &... John Porter
- Re: assign to magic name-of-function variable instead of &... Peter Scott
- Re: assign to magic name-of-function variable instead of &... John Porter
- Re: assign to magic name-of-function variable instead of &... Peter Scott
- Re: assign to magic name-of-function variable instead... David L. Nicol
- Re: assign to magic name-of-function variable instead of &... John Porter
- Re: assign to magic name-of-function variable instead of &... David L. Nicol
