On 2010.05.07 19:58, Uri Guttman wrote: >>>>>> "SB" == Steve Bertrand <st...@ipv6canada.com> writes:
> SB> (fwiw, and I don't have time to get into the rest of the code right now, > SB> I prefer whitespace, so I'd write that as): > > SB> my @ar1 = qw ( > SB> r2one > SB> r2two > SB> r2three # comment, reader needs info for this var > SB> r2four > SB> r2five # more comments > SB> ); > > it was a good idea suggesting qw but you can't put comments inside it > just like you can't inside any quoted string. heh... yep, I *knew* I should have tested/referred to working example first...thanks :) > SB> ..etc. However, there's probably another way to do that, but without > SB> knowing what your variables *mean*, it's too hard to tell. > > names should reflect usage, not be a placeholder or nmenonic. That pretty much sums up what I was trying to get at. > > > SB> my $v4glue = $dns->v4glue(); > SB> my $v6glue = $dns->v6glue(); > > SB> $self->data({ field => 'v4glue', value => $self->date() }) if $v4glue; > SB> $self->data({ field => 'v6glue', value => $self->date() }) if $v6glue; > > SB> I mean no offence. If anything, use more whitespace. Here's another > SB> quick rewrite (let the Gods fix it better, as I didn't bother actually > SB> reading what the code does ;) > > SB> my @exp; > SB> my $r1name = 'r1_r1r1'; > SB> my $arcnt = 1; > > SB> for my $element ( @ar1 ) { > > SB> push @exp,$element; > > SB> $arcnt++; > > SB> if (( $arcnt % 4 ) == 0 ) { > > SB> dispt( $r1name, @exp ); > > SB> # my instincts say that $arcnt should be reassigned > SB> # within this for loop... > > SB> @exp = (); > > i haven't looked at the previous code but why is that being cleared here > and pushed above? What part? The @exp clearing? My intention was to leave the code intact...I accidentally erased a couple of things... Next time, before I respond, I'll try to figure out exactly what the code is doing. Steve -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/