in reply to Annotation of Anonymous Blocks
In your initial example, I could see some merit in doing:
my $BigCalc = do { my $SmallCalc; .... $smallCalc; };
But for the most part, the only occasions I've felt the need to use bare-blocks are:
{ lock $fred; $fred = 3; }
{ my $var; sub fred { if( $var++ ) { ...; } ... } }
This use has mostly been superceded by state variables.
In neither case have I felt the need to introduce the opening brace in any way. Indeed, I think to do so would be more rather than less likely confusing; potentially flattering to deceive that the use of the construct was more important than it is.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Annotation of Anonymous Blocks
by Anonymous Monk on Sep 30, 2011 at 13:26 UTC |