in reply to Tkx's treeview syntax question

Well, you really need to refresh the syntax stuff. You cannot pass function parameters with the coderef. Your command should be something like:
-command => sub { resort (\$sortflag, \@item) ; }
I haven't used Tkx much, but I'm sure the rest of it should be something like this:
$tree -> configure(heading => "#1", -command => sub { resort (\$sortfl +ag, \@item) ; } );