redmustang has asked for the wisdom of the Perl Monks concerning the following question:
I cannot figure out how to build an array of variable length
#incomplete sub wall { $count = 0; while ($count < $ pieces) { $count +=1; @stripe =(); } $wall_height = user input is 50 $stripe= user input is 11 $pieces=int($wall_height/$stripe); # pieces 50/11 = 4 #this the answer I want to come up with $stripe[0]= "11" $stripe[1]= "22" $stripe[2]= "33" $stripe[3]= "44"
next question: making a second set of stripes posted in direct replies by redmustang
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Building an array, "stripes on a wall"
by wind (Priest) on Jun 12, 2011 at 03:38 UTC | |
|
Re: Building an array, "stripes on a wall"
by deep3101 (Acolyte) on Jun 12, 2011 at 06:43 UTC | |
|
Re: Building an array, "stripes on a wall"
by Anonymous Monk on Jun 12, 2011 at 05:56 UTC | |
|
Re: Building an array, "stripes on a wall"
by PeterPeiGuo (Hermit) on Jun 12, 2011 at 07:02 UTC | |
|
Re: Building an array, "stripes on a wall"
by Not_a_Number (Prior) on Jun 12, 2011 at 12:44 UTC | |
|
Re: Building an array, "stripes on a wall"
by redmustang (Novice) on Jun 13, 2011 at 02:00 UTC | |
|
Re: Building an array, "stripes on a wall"
by redmustang (Novice) on Jun 12, 2011 at 18:15 UTC |