troubleshooting Question

PERL programming

Avatar of Vincentg
VincentgFlag for Netherlands asked on
Scripting Languages
1 Comment1 Solution240 ViewsLast Modified:
I need some help with perl. Can someone help me with this code. It's running on NT5 : grep.exe and awk.exe are in the cgi-bin directory.
The problem at this moment is that it keeps on searching and no error is displayed.

Thanks,
Vincent

#!c:\perl\bin\perl.exe

$DOCROOT="c:\\Inetpub\\www\\test\\www\\instel\\gen\\twente\\gen2www\\";
$AWK="c:\\inetpub\\www\\test\\cgi-bin\\awk.exe";
$GREP="c:\\inetpub\\www\\test\\cgi-bin\\grep.exe";
$STR1="    1 2  3                             4                                       5                                       ";
$STR2="6                         7      8</PRE><BR><PRE>";

print "Content-Type: text/html\n\n";
print "<HTML>";
print "<HEAD><TITLE>genealogische zoekmachine</TITLE></HEAD>";
print "<BODY>";


$VALUE= `set | $GREP QUERY_STRING | $AWK -F= "{print \$3}"`;
if ( "x$VALUE" eq "x" ) {
  print "$VALUE";
  print "<H2>Probleem: </H2><H3>Geen invoer!</H3>";
  print "</BODY></HTML>";
  exit 1;
};

print "<P><UL><BR><FONT SIZE=+1><B><I>Legenda:</I></B></FONT><P>";
print "1 = Recordnummer<BR>";
print "2 = Geslacht<BR>";
print "3 = Naam en voornamen<BR>";
print "4 = Geboorteplaats<BR>";
print "5 = Geboortedatum<BR>";
print "6 = Overlijdensdatum<BR>";
print "7 = Recordnummer vader<BR>";
print "8 = Recordnummer moeder<BR></UL><P><HR WIDTH=33% ALIGN=LEFT>";

$FOUND="no";

`$GREP -i $VALUE $DOCROOT*.www | $AWK -F: "\
    \$1 == prev { print(\$2)}; \
     \$1 != prev { \
     print "</PRE><P><B>Bestandsnaam:</B><BR><I>",\$1,"</I>\n<PRE>"; \
        print "    1  2 3                                                                     4                                                 5          6";\
        print "</PRE><BR><PRE>"; \
        print (\$2); \
        $FOUND="yes"; \
        prev = \$1;\
    }"`;

if ( "$FOUND" == "no" ) {
     print "<H3>Geen namen gevonden!</H3>";
};

print "</BODY></HTML>";
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros