hi all,

I am having problems printing this doubly list. the bug statment prints the
expacted so I think I have the list setup right, but I cant get this list to
print in reverse... any ideas ??

Thanx in Advance

#!/usr/bin/perl -w

$debug=1;

for($i=1;$i<10;$i++){
      $list = {value=>$i,prev=>$list,next=>${prev} };
 print "prev=$prev\tlist=$list\n" if( $debug);
      $prev= $list;

}

$iterator = $list;
while($iterator){
      print "$iterator->{value} ";
      $iterator = $iterator->{next};
#$iterator=$iterator->{prev};
}
print "\n";


print "In reverse \n";
$iterator = $prev;
while($iterator){
 print "$iterator->{value} ";
 $iterator= $iterator->{prev};
}


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to