[Charlottesville-pm] Is this ugly?
Greg Brennan
greg at rimmkaufman.com
Fri Aug 4 13:51:46 PDT 2006
Hiya,
Can I get an opinion on the ugliness of this pattern?
use English;
my $stuff;
BLK:
while (1){
eval{$stuff = get() || last BLK;}
next BLK if $EVAL_ERROR;
eval{more($stuff}};
next BLK if $EVAL_ERROR;
eval{final($stuff)};
next BLK if $EVAL_ERROR;
}
continue{
if ($EVAL_ERROR){
$error_line{$stuff}++;
$error_type{$EVAL_ERROR}++;
};
$count++;
};
undef $stuff;
I intend it to let me pull most of the error checking clutter out of the
main loop. I've never seen the use for a continue block before.
(and yes I'll have strict and warnings in the real code)
--
Greg Brennan
Director of Information Systems
The Rimm-Kaufman Group LLC
www.rimmkaufman.com
greg.brennan at rimmkaufman.com
(434) 970-1010 Ext. 112
More information about the Charlottesville-pm
mailing list