Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

perl2exe problem

Status
Not open for further replies.

oinkers

Programmer
Jun 14, 2000
23
US
I am using perl2exe to convert my perl scripts into executable files. However, when i convert it and run the file it gives me an error on the module that im using. The script runs fine in perlbuilder. Is there something i have to do with modules before using perl2exe?<br>The error is :<br><br>Can't locate LWP/UserAgent.pm in @INC (@INC contains: PERL2EXE_STORAGE C:\TEMP lib\site ../lib .) at htmlexample.pl line 2
 
haven't used perlbuilder or perl2exe - but I'm thinking of it and would be very interested to hear how you're getting on<br><br>presume the module *is* in a @INC dir?<br><br>have you tried a test script with a minimal module? <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
perlbuilder is really good for debugging..i really like the interface. perl2exe works great on normal scripts that ive written, cept it just wont work with the LWP module. Im still tryint to figure out why.
 
CAN ANYONE TELL ME WHY MY SUB FUNCTION DOESNT WORK<br>#!/usr/bin/perl<br><br># Get the input from student_form.html<br>read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});&nbsp;&nbsp;<br>print&quot;Content-type: text/html\n\n&quot;;<br><br># Split the name value pairs<br>@pairs = split(/&/, $buffer);<br><br>foreach $pair (@pairs)<br>{<br>&nbsp;&nbsp;&nbsp;($name, $value) = split(/=/, $pair);<br><br>&nbsp;&nbsp;&nbsp;$value =~ tr/+/ /;<br>&nbsp;&nbsp;&nbsp;$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(&quot;C&quot;, hex($1))/eg;<br>&nbsp;&nbsp;&nbsp;$value =~ s/&lt;!--(.¦\n)*--&gt;//g;<br>&nbsp;&nbsp;&nbsp;if ($allow_html != 1)<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$value =~ s/&lt;([^&gt;]¦\n)*&gt;//g;<br>&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;$FORM{$name} = $value; #input text box from the html form<br>}<br><br>##Place values in variable user and pass<br>chomp($user = $FORM{'USERID'}); #varaible from form<br>&nbsp;&nbsp;<br>open (from, &quot;output.txt&quot;) or die &quot;Can't open file&quot;;<br>@line = sort &lt;from&gt;; #sort array id first <br><br>$i=1;&nbsp;&nbsp;#flag<br>$h=0;<br><br>foreach $input (@line)<br>{<br>&nbsp;&nbsp;&nbsp;@file = split (/,/, $input); #ignore commas then put in array @file <br><br>&nbsp;&nbsp;&nbsp;if($studid != $file[0]) #if theres no more to print exit<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($value eq $file[0])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$h++;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#flag<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;html&gt;\n&quot;;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;head&gt;\n&quot;;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;title&gt;Search Results&lt;/title&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;/head&gt;\n&quot;;<br> if($h eq 1)&nbsp;&nbsp;#call the heading once only<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;h1&gt;Search Results&lt;/h1&gt;\n&quot;;<br> &nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;HR&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;BODY BGCOLOR=#ffffff&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;BR&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;b&gt;Module($h) $file[6]&lt;b&gt;\n&quot;;&nbsp;&nbsp;#write module name<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;b&gt;Mark1:&nbsp;&nbsp;&nbsp;$file[10]&lt;/b&gt;\n&quot;;&nbsp;&nbsp;#write mark 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;b&gt;Mark2:&nbsp;&nbsp;&nbsp;$file[12]&lt;/b&gt;\n&quot;;&nbsp;&nbsp;#write mark 2&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;b&gt;Overall Mark:&nbsp;&nbsp;&nbsp;$file[14]&lt;/b&gt;\n&quot;; # write overall mark<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;b&gt;Grade:&nbsp;&nbsp;&nbsp;$file[15]&lt;/b&gt;\n&quot;; # write grade&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;/body&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print &quot;&lt;/html&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$i++;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if($value != $file[0] && $i &lt;= 1)&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&noid; #call subroutine for no id entry<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;}<br>}<br>close(from);<br>&nbsp;<br>#print message if no entry found<br>sub noid<br>{<br>&nbsp;&nbsp;&nbsp;$IP = $ENV{'REMOTE_ADDR'}; <br>&nbsp;&nbsp;&nbsp;print &quot;&lt;html&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;print &quot;&lt;head&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;print &quot;&lt;title&gt;Results&lt;/title&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;print &quot;&lt;/head&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;print &quot;&lt;h1&gt;Search Results&lt;/h1&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;print &quot;&lt;HR&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;print &quot;&lt;BODY BGCOLOR=#2F2F7D&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;print &quot;&lt;b&gt;Sorry! no entry found!&lt;/b&gt;&quot;;<br>&nbsp;&nbsp;&nbsp;print &quot;&lt;/body&gt;\n&quot;;<br>&nbsp;&nbsp;&nbsp;print &quot;&lt;/html&gt;\n&quot;;<br>} <br><br><br>
 
Looks like you might need to escape out the <font color=red>#</font> sign in the BODY tag.&nbsp;&nbsp;Perl sees the '#' as the beginning of a comment and does not evaluate the rest of the line.&nbsp;&nbsp;Consequently, your BODY tag never closes.<br><FONT FACE=monospace><br>print &quot;&lt;BODY BGCOLOR=\#2F2F7D&gt;\n&quot;;<br></font><br><br>Another approach might be....<br><FONT FACE=monospace><br>sub noid<br>{<br>$IP = $ENV{'REMOTE_ADDR'};<br>print &lt;&lt;EndPrint;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;title&gt;Results&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;h1&gt;Search Results&lt;/h1&gt;<br>&lt;HR&gt;<br>&lt;BODY BGCOLOR=#2F2F7D&gt;<br>&lt;b&gt;Sorry! no entry found!&lt;/b&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br>EndPrint<br>}<br></font> <p> <br><a href=mailto: > </a><br><a href= > </a><br> keep the rudder amid ship and beware the odd typo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top