[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pi3Perl some help (continuation)

Hi again,

Pi3Perl is not by all means what you expected by its name? But it's hot!
If you write a lot of CGI like I did in the last few months you've
to change your way of thinking.
The advantage of Pi3Perl is: you are close, closer, closest to
the Pi3API. This makes Pi3Perl especially usefull for some server plugins,
like the auth.pl example demonstrates.
But take notice of the differences between Pi3Perl and the classic
CGI script execution:
- The script name/parameters are hard coded as parameters of the
  Pi3WebPerl handler in the config file
- The $ENV isn't used for CGI-environment values
- The script input and output from/to the server does't work with
- The script has a sub-routine as the entry point for the handler
  (sub 'execute' in the hello.pl example)
- the response headers and other fields for the HTTP response are
  your thing (look into the hello.pl example).
- you can place global values in the config file to be copied into
  corresponding global script variables (auth.pl, $AuthFile $Realm
  versus Config.Pi3 AuthFile="../Auth.txt" Realm="auth-realm")
- read server variables with Pi3::PIDB_lookup - your new $ENV
- write server variables with Pi3::PIDB_replace - your new power

Why to make the change to Pi3Perl?
- Faster
- Write server code without compiler
- But if you just like to write a simple CGI-script please code it for
  the Standard CGI interface

To be continued.

with regards

Holger 'Zimpel' Zimmermann    Contact me:
Wendishain                    tel./fax company: on demand
Germany                       tel./fax private: on demand
homepage: http://home.t-online.de/home/zimpel/
web server: surf to it from my homepage (online every
            Sunday 20:00-24:00 GMT, start shifted again)
e-Mail:     zimpel@t-online.de