in reply to Tk::LCD Investigations

# Scale the box and colon circles by a scale factor sub scale { my($bx, $tc, $bc) = @_; $selw = $baseelw * $scale; # Scale the eleme +nt width $bx = [map {$_ * $scale} @baseBox]; # Scale elements $tc = [map {$_ * $scale} @baseTopColon]; $bc = [map {$_ * $scale} @baseBotColon]; foreach my $i(0 .. $#$bx) { # Return scaled e +lements $_[0][$i] = @$bx[$i]; # via referenc +es } foreach my $i(0 .. $#$tc) { $_[1][$i] = @$tc[$i]; } foreach my $i(0 .. $#$bc) { $_[2][$i] = @$bc[$i]; } $scale = $scale + 1; # Bump for next c +ycle return; }

That could be written more simply as:

# Scale the box and colon circles by a scale factor sub scale { my($bx, $tc, $bc) = @_; $selw = $baseelw * $scale; # Scale the eleme +nt width @$bx = map {$_ * $scale} @baseBox; # Scale elements @$tc = map {$_ * $scale} @baseTopColon; @$bc = map {$_ * $scale} @baseBotColon; ++$scale; # Bump for next cycle return; }
Naked blocks are fun! -- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re^2: Tk::LCD Investigations
by jmlynesjr (Deacon) on Mar 17, 2023 at 18:00 UTC

    jwkrahn, thank you for the hint! I came very close to that in one of my many trials. I only missed by an @. I'll update my code.

    James

    There's never enough time to do it right, but always enough time to do it over...