In Perl you don't need to explicitly define the array length as it dynamically allocates memory for the purpose on it's own. This is by far the best feature while working on arrays in Perl.
You can use the push(@stripe,$pieces) with each time you do he calculation of $wall_height/$stripe. Or you even may use the unshift(@stripe,$pieces) function, whichever suites you more.
In reply to Re: Building an array, "stripes on a wall"
by deep3101
in thread Building an array, "stripes on a wall"
by redmustang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |