home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Add-Ons / MPW / MPW noweb 2.7 / contrib / partingr / xpand < prev   
Encoding:
Text File  |  1995-05-30  |  524 b   |  21 lines  |  [TEXT/MPS ]

  1. #!/usr/common/bin/perl
  2. while(<>)
  3. {
  4. # expand wildcard references here, then process as normal
  5.   if(/^@(use|defn) (.*)$/)
  6.     {
  7.       $action=$1;
  8.       if($2=~/\.{3}$/)
  9.       { @matches=grep(/^$2.*/i,split(/§/,$known));
  10.         if($#matches>0)
  11.           { die "\nAmbiguous module name `$mod...'"; }
  12.         elsif($#matches==-1)
  13.           { die "\nNo match for name `$mod...',line $i "; }
  14.         else
  15.           { $mn=@matches[0]; $_="@$action $mn\n"; }
  16.       }
  17.       else { $known=$known . "§$2"; }
  18.     }
  19.   print STDOUT $_;
  20. }
  21.