[ic] Bad GlobalSub

Murray Gibbins interchange-users@lists.akopia.com
Fri Jul 6 04:00:01 2001


Richard Eicher II wrote:
> 
> Hello,
> 
> Here is my global sub linkpt:

> 
> Anyone see what I have done wrong?
> 
> Thank you for your time,
> Richard Eicher II
> www.texol.net

ok Global subs can be hard to debug as interchange does not produce very helpful
debugging. If you had checked the archives you would have found this piece of
bash that produces more information and should be able to help you. Feel free to
adapt it if you like...

---BASH
#!/bin/bash

#   self_test.sh
# Test a minivend/interchange Global subroutine
# Usage ./self_test.sh  <file with only global sub in it>



if [ $# = 0 ] 
then
        echo "Syntax =  ./self_test.sh  <file with only global sub in it>";
        exit 1;
fi ;



#cat $1 | perl -e '@l=map{/^\s*Global.*<<(.*)/?$GL=$1:1;$_}<>;map{$str.=$_}grep{
!/(?:^\s*globalsub\s*<<)|(^$GL)/i}@l;eval$str;print"\n\nGlobal Sub ",$@?" failed
\n\n$@":" passed\n\n";'

cat $1 | perl -e
'map{$s.=$_}grep{!/(?:^\s*globalsub\s*<<(.*)$)|(^\1)/i}<>;eval$s;print"\nGlobal
Sub ",$@?" failed\n$@":"passed","\n\n";'

---BASH

Yours
Murray

-- 
  ____
  \__/    Murray Gibbins             murray@scotweb.ltd.uk
  /  \    Programmer
_ \__/ _  ================================================
\\ || //  Scotweb Limited,             info@scotweb.ltd.uk
 \\||//   13a Albert Terrace,    http://www.scotweb.ltd.uk
  \||/    Edinburgh EH10 5EA   Tel: +44 (0)  131 270 82 33
   ||     Scotland. Europe.    Fax: +44 (0) 7020  93 49 04