On Thu, 19 Oct 2000, Marcus wrote:

> Date: Thu, 19 Oct 2000 19:19:44 +0200
> From: Marcus <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: Solved: Params problem with POST
> 
> 
> Thanks to everybody who helped with the params disappearing with POST in one of my 
>scripts. The solution was tricky, especially since CONTENT_LENGTH was set correctly, 
>but the buffer was empty. However that was also the key to the solution. In case 
>it'll help anybody else, here's an explanation.
> 
> POST uses the stdin buffer to store the string. I was "using" a library I'd written 
>which reads the contents of a file with
> @data = <FILE>;
> 
> I presume the stdin buffer was being cleared when this sub was compiled.
> 
> Solutions
> 1) Get the params before the "use" statement.
> 2) "require" instead of "use"
> 
> I understand the difference with the latter is run-time vs. compile time, however I 
>don't completely understand what's going on, and what the real difference is.
> I believe I understand the difference in C, but Perl still confuses me at times.
> 
> Can anybody explain compile time vs. run time and what's going on with "use" and 
>"require"?
Before Perl executes anything it "compiles" it. This is how it finds all 
the syntactical errors in one pass rather than only as it executes 
various branches of code.

"use" is processed by the compiler step so the related code, constants, 
etc. will be brought in no matter whether the use is in a brantch of code 
which is never taken or is in a bratch which is always taken. Basically, 
all the "use" statements fire.   Require statements are executed (or not) 
as they occur during the execution of the program.  You can chose amoung 
various require statements, you will always get the "benefit" of any 
"use" statement in the program.  Hope this helps. 

> 
> Thanks,
> 
> Marcus Friedlaender
> 
> 

Sincerely,

William Mussatto, Senior Systems Engineer
CyberStrategies, Inc
ph. 909-920-9154 ext. 27

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to