I have started to really do some wierd things lately and I was wondering if I'm developing a poor style. I realize that TIMTOWTDI so maybe what I'm really asking is... "is there a much better way?"
I have two chunks of code to show you... maybe you can give some advice.
The first is just to populate a single var... I ended up doing this:
$header{"Number of Drills"} = &{ sub { my $ret; foreach my $l ( @drill_arr ) { foreach ( values %{$l->tool} +) { $ret += $_->count; } } return $ret; } };
The next is to get the elements I want from an array of hashes:
my @layer_list = grep { $_->{layer_type} eq "signal" || $_->{layer_type} eq "mixed" || $_->{layer_type} eq "power_ground" } grep { $_->{context} eq "board" } @matrix_array;
these both work but have been nagging me some so I wanted to show you all in the hopes you could set me straight if need be.
Thanks for your help
Prost,
Moe
In reply to Am I developing poor style? by el-moe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |