×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

perl2exe problem

perl2exe problem

perl2exe problem

(OP)
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?
The error is :

Can't locate LWP/UserAgent.pm in @INC (@INC contains: PERL2EXE_STORAGE C:\TEMP lib\site ../lib .) at htmlexample.pl line 2

RE: perl2exe problem

(OP)
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.

RE: perl2exe problem

CAN ANYONE TELL ME WHY MY SUB FUNCTION DOESNT WORK
#!/usr/bin/perl

# Get the input from student_form.html
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});  
print"Content-type: text/html\n\n";

# Split the name value pairs
@pairs = split(/&/, $buffer);

foreach $pair (@pairs)
{
   ($name, $value) = split(/=/, $pair);

   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   $value =~ s/<!--(.¦\n)*-->//g;
   if ($allow_html != 1)
   {
      $value =~ s/<([^>]¦\n)*>//g;
   }

   $FORM{$name} = $value; #input text box from the html form
}

##Place values in variable user and pass
chomp($user = $FORM{'USERID'}); #varaible from form
  
open (from, "output.txt") or die "Can't open file";
@line = sort <from>; #sort array id first

$i=1;  #flag
$h=0;

foreach $input (@line)
{
   @file = split (/,/, $input); #ignore commas then put in array @file

   if($studid != $file[0]) #if theres no more to print exit
   {
      if($value eq $file[0])
      {
         $h++;     #flag
         print "<html>\n";  
         print "<head>\n";  
         print "<title>Search Results</title>\n";
         print "</head>\n";
if($h eq 1)  #call the heading once only
         {
            print "<h1>Search Results</h1>\n";
    print "<HR>\n";
         }
         print "<BODY BGCOLOR=#ffffff>\n";
         print "<BR>\n";
         print "<b>Module($h) $file[6]<b>\n";  #write module name
         print "<b>Mark1:   $file[10]</b>\n";  #write mark 1
         print "<b>Mark2:   $file[12]</b>\n";  #write mark 2  
         print "<b>Overall Mark:   $file[14]</b>\n"; # write overall mark
         print "<b>Grade:   $file[15]</b>\n"; # write grade  
         print "</body>\n";
         print "</html>\n";
      }
      else
      {
         $i++;
         if($value != $file[0] && $i <= 1)  
         {
               &noid; #call subroutine for no id entry
         }
      }
   }
}
close(from);
 
#print message if no entry found
sub noid
{
   $IP = $ENV{'REMOTE_ADDR'};
   print "<html>\n";
   print "<head>\n";
   print "<title>Results</title>\n";
   print "</head>\n";
   print "<h1>Search Results</h1>\n";
   print "<HR>\n";
   print "<BODY BGCOLOR=#2F2F7D>\n";
   print "<b>Sorry! no entry found!</b>";
   print "</body>\n";
   print "</html>\n";
}


RE: perl2exe problem

Looks like you might need to escape out the # sign in the BODY tag.  Perl sees the '#' as the beginning of a comment and does not evaluate the rest of the line.  Consequently, your BODY tag never closes.

print "<BODY BGCOLOR=\#2F2F7D>\n";


Another approach might be....

sub noid
{
$IP = $ENV{'REMOTE_ADDR'};
print <<EndPrint;
<html>
<head>
<title>Results</title>
</head>
<h1>Search Results</h1>
<HR>
<BODY BGCOLOR=#2F2F7D>
<b>Sorry! no entry found!</b>
</body>
</html>
EndPrint
}




keep the rudder amid ship and beware the odd typo

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close