Home
TeamSite
how to pre compile .ipl files in Teamsite
Sunil Mugalavally
Hi,
Anybody know of a way to pre compile .ipl files and have them as .cgi (binary) in Teamsite.
Thanks in advance.
Find more posts tagged with
Comments
nipper
CGIs can be interpreted. We do that.
If you want a compiled version of perl, this link is from another post, but will be a good start (for Windows):
http://www.indigostar.com/perl2exe.htm
.
HTH
me
Adam Stoller
Alternatively, if you are on Windows, you can create a Perl script in IWHOME/httpd/iw-bin/ (e.g. myscript.ipl) and then copy show_env.cgi to myscript.cgi - as show_env.cgi is just a binary wrapper that takes the current filename and swaps in the .ipl for the .cgi) - this was needed in older versions of TeamSite (pre 5.5.2, perhaps even pre 5.0x can't remember) - generally you should be able to just set the #! line correctly at the top of the script and use the .ipl directly.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Sunil Mugalavally
Thanks Andy.
>CGIs can be interpreted. We do that.
Can you please explain this..
Also my intention here is to secure the perl code from being read by other users who have access to the files. Having them as compiled/ in binary format will prevent them from reading the code.
For example in teamsite, the "show_env.ipl" and "show_env.cgi" essentially give the same output and the CGI seems to be a pre compiled form.
I was thinking something on these lines.
nipper
>Also my intention here is to secure the perl code from being read by other users who have access to the files. Having them as
>compiled/ in binary format will prevent them from reading the code.
Depends on what you are trying to do. Since the code sits on the server, many people will not have access to the filesystem
to actually view the code.
If you are placing in DB passwords or something like that, encoding it & hiding that info is important. There was another
thread on this topic. If I can find it I will post the URL.
>For example in teamsite, the "show_env.ipl" and "show_env.cgi" essentially give the same output and the CGI seems to be a pre compiled form.
>I was thinking something on these lines.
Nope. show_env.cgi (at least on my system, TS 552 Solaris) is a Perl script.
That is a good place for you to start. Copy show_env.cgi to something else and make it a custom menu item. Then add your
perl as you need it.
What are you trying to do ? Does show_env.cgi give you the info you need to run your new CGI ?
One last tip, show_env.cgi returns different information depending on where you are. Viewing task list does not provide
as much stuff as selecting a file in a WA. Error checking is a good thing.
HTH
Andy
Adam Stoller
show_env.cgi on Windows is a binary wrapper that looks at the name it was called with ("show_env.cgi") and substitutes ".ipl" for ".cgi" and then runs that ("show_env.ipl")
show_env.cgi on Solaris is just the Perl script - the wrapper was originally needed to get past IIS bogosities on Windows only.
The perl2exe program can be used to compile perl code into executable form, though I've not tried using it for TeamSite (actually I haven't tried using it in over 5 years - period) - but that would probably accomplish the kind of thing you're talking about - however, you still need the Perl code somewhere, so that you can change the code as needed - and you'll need to store it somewhere that you (or whomever comes to maintain the site after you) can find - so it's only marginal protection.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Sunil Mugalavally
I understand what you say..
Of course not many people have access to the perl scripts themselves although for code privacy I didn't want to distribute/expose the raw perl scripts.
We are on windows, TS 5.5.2 and the "show_env.cgi" supplied is not a perl script. Its not in the form that' editable. I have just attached the "show_env.cgi" in this post.
Thanks again.
Sunil Mugalavally
Ghoti,
This makes perfect sense to me.
I will research on the perl2exe and find out if it helps me.
Thanks all.