in reply to help with simplifying program

That makes no sense?

Each of your inner loops is limited to the value of the preceding loop counter-1, so can never attain a value that would trigger your condition.

Ie. $x is limited to $w-1, so $x can never become equal to $w + $s for any value of $s, unless $s was -1 or less, but your $s loop start from 1 and increases.

In other words; your unless condition will always be false, and so it is doing nothing (except consuming cycles).


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: help with simplifying program
by tobyink (Canon) on May 24, 2013 at 05:45 UTC

    True. $s should really go from -1 to -33 I think.

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name