in reply to Re: pop and shift not reversible ( while @array )
in thread pop and shift not reversible
I would be using the offered solution.my @q = ( 1,2,0,4 ); $first = pop @q; print "q $#q pop ",$first,"->"; while ($#q+1) { $next = pop @q ; print ",",$next }; ---- Gives q 2 pop 4->,0,2,1
while( @array ) { my $next = shift @array; }
|
|---|