CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
HELP: perlcc question

 



checkmate2001
stranger

Jul 29, 2001, 11:46 PM

Post #1 of 5 (1755 views)
HELP: perlcc question Can't Post

Hi, all
I'm trying to compile a very simple CGI program with
perlcc. The source code is as follows:

#!/usr/bin/perl
use CGI;

$q = new CGI();

print $q->header();
print "hello";

The compilation process went quietly but when i tried to run the program from command line. It always reports that
"Undefined subroutine CGI::read_from_cmdline"

OS: freebsd
perl version: 5.005_03

How can I get the compilation passed in such configuration?

Thanks for your answer in advance!




mhx
Enthusiast

Jul 30, 2001, 12:51 AM

Post #2 of 5 (1751 views)
Re: HELP: perlcc question [In reply to] Can't Post

First, I'd like to know why you would want to compile this program?
I cannot test it on my machine, since perlcc and my HP-UX cc (or to be exact cpp) don't like to cooperate at the moment and I don't have to time to figure out why.
But I've got an idea: Perhaps you should try to also compile CGI.pm (and other modules that your script requires). But this is only a feeling.
Perhaps you should wait for someone who has more experience with perlcc. This shouldn't be hard, since I have zero experience with it ;-)

-- Marcus


Code
s$$ab21b8d15c3d97bd6317286d$;$"=547269736;split'i',join$,,map{chr(($*+= 
($">>=1)&1?-hex:hex)+0140)}/./g;$"=chr$";s;.;\u$&;for@_[0,2];print"@_,"



checkmate2001
stranger

Jul 30, 2001, 6:05 PM

Post #3 of 5 (1745 views)
Re: HELP: perlcc question [In reply to] Can't Post

Thanks for your quick response, Marcus 8-)

oh.. the purpose is to hide the source and reduce start
up time of those cgi program.

I've tried to compile CGI.pm with
perlcc -mod CGI.pm
but failed. The error message is
...
CGI.pm syntax OK
Can't locate object method "FLAGS" via package "B::SPECIAL" at /usr/libdata/perl/5.00503/mach/B/Stackobj.pm line 216.
END failed--cleanup aborted.
ERROR: In generating code for CGI.pm!

And after check the source of Stackobj.pm, no method named FLAGS was found.
I wonder if it can't be accomplished in such os/ perl version combination. If so, are there other ways to do it?





mhx
Enthusiast

Jul 30, 2001, 9:37 PM

Post #4 of 5 (1744 views)
Re: HELP: perlcc question [In reply to] Can't Post

Sorry I can't help you with your real problem, but I still don't see the need for compiling the script.

In Reply To
...the purpose is to hide the source...

If your server is configured correctly, no one else but you should be able to see the code. If someone could break such a well configured system, he'd be happy with the compiled code, too ;-)

In Reply To
...and reduce start up time of those cgi program.

I don't think you'll be able to reduce the startup time significantly, because the compiled scripts become *very* large executables (at least that's what I've seen: a 'hello world' compiled into a one meg executable; only seen it, didn't figure it out myself). If it's speed you want, try to use mod_perl for Apache, which reduces the overhead of running the Perl interpreter all the time, or (if it's really neccessary) write your CGI application in C.
Isn't an answer to your question, hope it helps anyway...

-- Marcus



Code
s$$ab21b8d15c3d97bd6317286d$;$"=547269736;split'i',join$,,map{chr(($*+= 
($">>=1)&1?-hex:hex)+0140)}/./g;$"=chr$";s;.;\u$&;for@_[0,2];print"@_,"



checkmate2001
stranger

Jul 31, 2001, 12:00 AM

Post #5 of 5 (1740 views)
Re: HELP: perlcc question [In reply to] Can't Post

OK, Let me try to pursuade the manager...
Seems to be one solution :D

Thank you anyway


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives