Gossamer Forum
Home : General : Perl Programming :

Re: [Wychwood] push new element to array

Quote Reply
Re: [Wychwood] push new element to array In reply to
thanks for everyone .i will go for a try


i am try to get it to work in another approach. while still got the problem


for($i=0; $i<=10;$i++)
{

$i ==5 or next; #### $i ==100 or $i == 5
my $swithnew = "old";
printf " $i next\n";
printf "$i swithnew= $swithnew xxx\n";
}

if ($swithnew=null ) { printf "$i it is an old value. we need to splice the array with new value\n"; }
else { printf " $i it is an new value. we have to puch the new value to the array \n"; }


----------------------
when i set $i ==5
the script print out 11 it is an old value. we need to splice the array with new value
this is the result i am expected

while i set $i ==100
the script pint out "11 it is an new value. we have to puch the new value to the array " which is out of my expectatioin result. what i expected is " it is an new value. we have to puch the new value to the array "


what is wrong with the code?

Thank you in advance
Subject Author Views Date
Thread push new element to array courierb 10375 Sep 28, 2007, 12:21 PM
Thread Re: [courierb] push new element to array
tandat 10069 Sep 29, 2007, 12:35 AM
Thread Re: [tandat] push new element to array
Wychwood 10088 Sep 29, 2007, 2:11 AM
Post Re: [Wychwood] push new element to array
courierb 9964 Sep 30, 2007, 6:41 AM
Post Re: [Wychwood] push new element to array
courierb 9989 Sep 30, 2007, 6:51 AM
Post Re: [tandat] push new element to array
courierb 9983 Sep 30, 2007, 6:53 AM
Thread Re: [tandat] push new element to array
courierb 9940 Oct 1, 2007, 1:02 AM
Thread Re: [courierb] push new element to array
tandat 9921 Oct 1, 2007, 5:36 AM
Post Re: [tandat] push new element to array
courierb 9863 Oct 1, 2007, 1:58 PM
Thread Re: [tandat] push new element to array
courierb 9858 Oct 1, 2007, 3:34 PM
Thread Re: [courierb] push new element to array
tandat 9844 Oct 1, 2007, 6:59 PM
Thread Re: [tandat] push new element to array
courierb 9831 Oct 2, 2007, 4:35 AM
Post Re: [courierb] push new element to array
courierb 9764 Oct 3, 2007, 12:09 AM