+ while ($z <= $#{$smsg}) {
+
+ if ($smsg -> [$z] -> {level} > $oldlevel) {
+ push @path => $z;
+ $oldlevel = $smsg -> [$z] -> {level};
+ }
+ elsif ($smsg -> [$z] -> {level} < $oldlevel) {
+ splice @path, $smsg -> [$z] -> {level};
+ push @path => $z;
+ $oldlevel = $smsg -> [$z] -> {'level'};
+ }
+ else {
+ $path[-1] = $z;