When we start the debugger for our 4gl programs, the source path environment variable is not always correctly set (actually its never correctly set, its just set to a best guess default), so I wrote something to scan the Makefile and set the source path to the right library directories before starting the debugger. My favorite bit from that script is this:
if (my $status = s/^\s*LIBFILES\s*=// .. !s/\\$//) { push @libs, split; last if $status =~ /E0/; }I had to add comments (to the effect of "From the start of the LIBFILES section to the first line which doesn't end in a backslash) and explain the flip-flop operator for the benefit of the (novice but only) other perl programmer in the office.