
sleuth
Enthusiast
Jan 18, 2001, 1:33 PM
Post #5 of 10
(764 views)
|
|
Re: a weak mind want to know :)
[In reply to]
|
Can't Post
|
|
Ok, you lost me, I gave your the way to do it using a hash but you still use, $v{'1'} =15,$v{'2'}=1,$v{'3'}=235; $count1 = $v{'1'}+$v{'2'}+$v{'3'}; @count = split(//, $count1); What are you trying to do exactly, I'm confused there, The reason you get <img border="0" src="?Community=Shake&Bake=2.gif" alt="2"> <img border="0" src="?Community=Shake&Bake=5.gif" alt="5"> <img border="0" src="?Community=Shake&Bake=1.gif" alt="1"> <img border="0" src="?Community=Shake&Bake=.gif" alt=""> Is because your not looping through the array correctly, you are using ++$i and that starts counting at 1. When the array starts at 0. Then it counts 1 extra time at the end. It's just offset by 1, so it misses the first and last value in the array. You could even do this, foreach $dig (@count){ print qq~<img border="0" src="?Community=Shake&Bake=$dig.gif" alt="$dig">~; } Which is a lot easier. Instead of this three step process, $v{'1'}=15,$v{'2'}=1,$v{'3'}=235; $count1= $v{'1'}+$v{'2'}+$v{'3'}; @count= split(//, $count1); You could actually make this a one step process, push(@count,"15 2 1 235"); Then loop through that. What do you mean split (values %x) into each numer, I don't understand the question. Do you want to know how to get 1 and get 15 out of $v{'1'}? Sleuth
|