unknown
  @   ]ˆl–Ðz¾”êeJ q@ãm\êbÑ¿�þDÛ­¬Ð+-8ÛM‰ ?æƒ}·Ÿå_ˆI|¥�+V[(Âä %u    ]eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
        if 0;

#D \module
#D   [       file=texfind.pl,
#D        version=1998.05.10,
#D          title=\TEXFIND, 
#D       subtitle=searching files, 
#D         author=Hans Hagen,
#D           date=\currentdate,
#D      copyright={PRAGMA / Hans Hagen \& Ton Otten}]
#C
#C This module is part of the \CONTEXT\ macro||package and is
#C therefore copyrighted by \PRAGMA. See licen-en.pdf for 
#C details. 

# test with "doif(un|)defined"

use strict ; 
use Getopt::Long ;
use File::Find ;
use Cwd ;
use Tk ; 
use Tk::widgets  ; 
use Tk::ROText ;

use FindBin ;
use lib $FindBin::Bin ;
use path_tre ; 

my $FileSuffix    = 'tex' ; 
my $SearchString  = '' ; 
my $Recurse       = 0 ; 
my $NumberOfHits  = 0 ;
my $QuitSearch    = 0 ; 
my $Location      = '' ;
my $currentpath   = '.' ;

my @FileList ; 

my ($dw, $mw, $log, $sea, $fil, $num, $but, $dir, $loc) ; 

$mw = MainWindow -> new () ; 
$dw = MainWindow -> new () ; 

$mw -> protocol( 'WM_DELETE_WINDOW' => sub { exit } ) ;
$dw -> protocol( 'WM_DELETE_WINDOW' => sub { exit } ) ;

$log = $mw -> Scrolled  ( 'ROText' ,
                          -scrollbars => 'se'           ,
                                -font => 'courier'      ,
                                -wrap => 'none'         , 
                               -width => 65             ,
                              -height => 22             )
           -> pack      (       -side => 'bottom'       ,
                                -padx => 2              , 
                                -pady => 2              ,
                              -expand => 1              ,
                                -fill => 'both'         ) ;

$sea = $mw -> Entry  (  -textvariable => \$SearchString , 
                                -font => 'courier'      ,
                               -width => 20             )
           -> pack   (          -side => 'left'         , 
                                -padx => 2              , 
                                -pady => 2              ) ;

$fil = $mw -> Entry  (  -textvariable => \$FileSuffix   ,
                                -font => 'courier'      ,
                               -width => 5              ) 
           -> pack   (          -side => 'left'         , 
                                -padx => 2              , 
                                -pady => 2              ) ;

$but = $mw -> Checkbutton ( -variable => \$Recurse      ,
                                -text => 'recurse'      )  
           -> pack   (          -side => 'left'         ) ; 

$num = $mw -> Entry  (  -textvariable => \$NumberOfHits , 
                                -font => 'courier'      ,
                             -justify => 'right'        ,
                               -width => 5              )
           -> pack   (          -side => 'right'        , 
                                -padx => 2              , 
                                -pady => 2              ) ;

$loc = $mw -> Entry  (  -textvariable => \$Location     , 
                                -font => 'courier'      ,
                               -width => 8              )
           -> pack   (          -side => 'right'        , 
                                -padx => 2              , 
                                -pady => 2              ) ;

sub BuildDir 
  {  if (Exists($dir)) { $dir -> destroy } ;
     $dir = $dw -> Scrolled ( 'PathTree' ,
                               -scrollbars => 'se'         ) 
                -> pack     (      -expand => 1            , 
                                     -fill => 'both'       ,
                                     -padx => 2            , 
                                     -pady => 2            ) ;
     $dir -> configure      (        -font => 'courier'    ,
                                   -height => 24           , 
                                    -width => 65           , 
             