From: <sg...@us...> - 2003-09-05 09:28:59
|
Update of /cvsroot/libfunutil/libfunutil/toc/bin In directory sc8-pr-cvs1:/tmp/cvs-serv23887/toc/bin Modified Files: atsign_parse Log Message: Added recursive @symbol@ parsing, so symbols can refer to each other. Index: atsign_parse =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/bin/atsign_parse,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- atsign_parse 31 Aug 2003 20:27:39 -0000 1.3 +++ atsign_parse 5 Sep 2003 09:28:56 -0000 1.4 @@ -62,7 +62,7 @@ #print STDERR ": [$key]=[$val]\n"; if( $key =~ m|^include:(.+)| ) { $key = $1; - open INFILE, "<$val" or die "Cannot open file '$val', as requested by @include:$key@!"; + open INFILE, "<$val" or die "Cannot open file '$val', as requested by \@include:$key@!"; @foo = <INFILE>; close INFILE; $val = join( "", @foo ); @@ -72,11 +72,16 @@ } # /BEGIN while( <STDIN> ) { - foreach $k (keys(%args)) { - if( $_ !~ m|\@$k\@| ) { next; } - $v = $args{$k}; - $_ =~ s|\@$k\@|$v|g; - # print STDERR "replacing $k --> $v\n"; + + $loop = true; + while( $loop ) { + $cp = $_; + foreach $k (keys(%args)) { + $v = $args{$k}; + next unless $_ =~ s|\@$k\@|$v|g; +# print STDERR "replacing $k --> $v\n"; + } + $loop = 0 if $cp eq $_; } if( $op_cleanup ) { while( $_ =~ s|\@\S+\@||g ) {} |