Jenda Krynicky wrote: > From: Haim Ashkenazi <[EMAIL PROTECTED]> >> 1. when I put "#!/usr/bin/perl -wT" at the beginning of the file, and >> running "perl -cw <script>" I get an error: Too late for "-T" option >> at /usr/lib/cgi-bin/test.cgi line 1.", although the scripts runs ok >> from the web. this is very annoying because I have to write it without >> the "-T" option and add it only when I want to test it through the >> web. is there a way around it? > > You have to run the script by > > perl -cwT test.cgi > > perl has to be started with -T. > >> 2. Is there a way for me to control the error code returned by the >> browser (I'm not sure if that's what it's called, but I mean the one >> that returned "200 ok")? I want to send custom codes so the >> applications that parses the result can use it to determin actions. > > The exact way depends on whether you print the header by CGI.pm or do > it yourself. Generaly you need to print something like > > print "Status: 303 See Other\nContent-type: text/html\n\n"; > >> 3. I need to get the output of an executeable (to which I pass a >> parameter after checking that it holds only alphanumeric characters) >> and I was wondering if this is a secure way to run it: >> >> open ID, "-|', <executeable>, $args; >> $reply = <ID>; >> close ID; > > I think you meant > > open ID, "-|', <executeable>, @args; well, it's only one argument which I've called "args" for no reason :)
> > but other than that, yes this is the safest way. > > Jenda > ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== > When it comes to wine, women and song, wizards are allowed > to get drunk and croon as much as they like. > -- Terry Pratchett in Sourcery thanx a lot. it's very helpfull. Bye -- Haim -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]