ARGV in exec subprocesses
Stas, the example you supplied in the miniguide (http://perl.apache.org/guide/performance.html#Forking_or_Executing_Subprocesse) doesn't work. It's because the scalar returned by FreezeThaw::thaw contains shell escape chars, like: [|;] so system("program.pl $params") obviously will break. If the argument we will pass to the external script is just a simple scalar, regexing the arg is enough, like in a SIG{__DIE__} handler in my handler.pl: $SIG{__DIE__} = sub { local $ENV{'PATH'} = '/home/myhome'; my $params = $_[0]; $params =~ s#\n# #gs; $params =~ s/'/"'"/gm; my $taint_safe = ($params =~ m#(.*)#m)[0]; system("alertall '$taint_safe'"); }; But if the arg is in a more complicated type, of course stringification is essential, but then we have to make it safe for shell. MIME::Base64 is the easy way for this, but probably a bit overkill :-) Thanks for the excellent guide. Regards, Edwin.
Re: ARGV in exec subprocesses
On Fri, 11 Feb 2000, Edwin Pratomo wrote: > Stas, the example you supplied in the miniguide > (http://perl.apache.org/guide/performance.html#Forking_or_Executing_Subprocesse) > doesn't work. > It's because the scalar returned by FreezeThaw::thaw contains shell escape ^^ Sorry, I mean ::freeze. Regards, Edwin.
Reading config
Hi, how to get configuration values at run-time, such as DirectoryIndex? TIA. Edwin.
Re: Browser Sniffing
Ask Bjoern Hansen wrote: > > On Thu, 29 Jun 2000, Drew Taylor wrote: > > > I'm hoping it's been done already, because the user-agent strings are > > terribly inconsistent... > > I needed something like that once and ended up with this: > > sub UA { > my $ua = shift; > my $n = ""; > my $v = ""; this doesn't seem to be aware of either WAP browsers or the emulators. A typical usage of this is to return WML pages if the request comes from a WAP browser, otherwise return html pages. Regards, Edwin.
[Fwd: mod_eprl or PHP]
Edwin Pratomo wrote: > > Matt Sergeant wrote: > > > > On Wed, 26 Jul 2000, Denton River wrote: > > > > > HI list, > > > > > > My company is using mod_perl right now and i like it > > > alot, but now are they wanting us to start develop in > > > PHP i really like to stay mod_perl, so i am askin you > > > for some help, > > > > > > I would really like to have something to say to my > > > boss, > > > like this is why i want to use mod_perl instedd of PHP > > > so my question is "Why should i use mod_perl insted of > > > PHP. > > > > > > Denton > > > > > > ps. we are workin alot with XML. > > > > Well then mod_perl (well, Perl) has much more extensive XML support right > > now compared to PHP. I was talking to Rael Dornfest yesterday, and he's > > moving back to Perl development after developing PHP's most significant > > XML project (meerkat) because of the tools available under perl. > > Significant point. > The availability of perl programmers is decisive, too. > My company started with just two mod_perl programmers, and one php > programmer to built one HTML::Mason, and one php powered site. We > separate the content logic and the interface by writing Perl modules and > use Mason only for interface (html) generation. By that time, we thought > that it was difficult to get perl programmers while it was easier to get > a php one (in Indonesia). But the truth is that it was difficult to get > both whose skills are practical :-) > Then we welcome any non-perl programmers (whose interests in learning > perl), and trained them. It doesn't take long time to transform them > into skillful perl programmers. The result is today we have five more > mod_perl sites, while the php site is still one! > These three new perl programmers doesn't know much about mod_perl > stuffs, they just need to work on the interface (HTML::Mason stuffs) > because they can simply reuse the modules which I and my friend wrote > for the first site. > > My point here is: > Not all perl programmers need to master the complexity of mod_perl. Put > this task upon a small team which work on the back-end system, and let > others who doesn't have good knowledge on mod_perl to concentrate on the > html stuffs. Mason, or EmbPerl, or any embedded perl systems (in html) > are good choices, and their ease is comparable to php. > > Rgds, > Edwin. > > > > > -- > >
Re: AuthDBI with Interbase
Yury Vasiliev wrote: > > I use AuthDBI with Interbase > It works ok, but there are some strange error in log > > //--- > $Apache::DBI::VERSION = '0.87'; > $DBI::VERSION = "1.14"; > > Interbase 6.0 > > //--- Use the latest DBD::InterBase at http://sourceforge.net/projects/dbi-interbase/ This one is far more improved and stable than the previous one at CPAN. Once I've revised the FAQ, I'll put it at CPAN. I haven't tested AuthDBI with InterBase. Other DBI extension modules that I've known to work fine with DBD::InterBase are Apache::DBI, DBIx::Recordset, and DBIx::Tree (a small patch for DBI should be applied first, due to a small bug in fetchall_arrayref method). Tie::DBI _doesn't_ work. It uses LISTFIELDS command which is specific to MySQL, and causes the InterBase parser to fail. Rgds, Edwin.
Re: AuthDBI with Interbase
Gerald Richter wrote: > > > Other DBI extension modules > > that I've known to work fine with DBD::InterBase are Apache::DBI, > > DBIx::Recordset > > Was it necessary to add an entry in Compat.pm, or did it work out of the > box? If you made any changes in Compat.pm, please send them to me, so I can > include it in the next release of DBIx::Recordset Thanks, Gerald. The default values work just fine, with one exception: Placeholders => 3 But even without specifying this, it passes all of the make test. Rgds, Edwin.
Re: error messages..
You're exposing your username/password you're using to connect to your DBMS to public. Those messages are there because $Apache::DBI::DEBUG is set. Rgds, Edwin. Sam Park wrote: > > Anybody knows why I'm getting this messages...??? > 5744 Pinging 'prodcrank.excite.com~crank~crank~RaiseError=1' > 5744 Apache::DBI already connected to > 'prodcrank.excite.com~crank~crank~RaiseErr > or=1' > 5744 Pinging 'prodcrank.excite.com~crank~crank~RaiseError=1' > 5744 Apache::DBI already connected to > 'prodcrank.excite.com~crank~crank~RaiseErr > or=1' > 5744 Pinging 'prodcrank.excite.com~crank~crank~RaiseError=1' > 5744 Apache::DBI already connected to
Apache::Util routines
Guys, mod_perl 1.24: perl -M'Apache::Util qw(:all)' -e '$a = parsedate("")' Undefined subroutine &Apache::Util::parsedate called at -e line 1. Looks like I've been missing something? Rgds, Edwin.
Accelerated apache
Has anyone here try compiling mod_perl with apache patched with this: http://oss.sgi.com/projects/apache/ ? Either 1.3.12 or 1.3.14 stucked at : Connection.xs: In function `XS_Apache__Connection_remote_ip': Connection.xs:107: incompatible types in assignment make[5]: *** [Connection.o] Error 1 make[4]: *** [all] Error 1 Rgds, Edwin. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: number of pgsql childrens on persistant DBI connection
Emmanuel Pierre wrote: > > Hi all, > > on my DB server I have 245 "idle" postmasters process for 130 httpd > persistant DB connections alive. make sure you use the same connect attributes each time you invokes DBI->connect(). eg, a connect() with {RaiseError=>1} and another connect with {RaiseError=>1,Taint=1} gives two different persistent $dbh. To make this simpler, you'd better create a global $dbh by connect_on_init(),and use it anytime you need a $dbh. rgds, Edwin. > can anyone give me a clue how to manage this number of > unused/idleschildren and how to have them quickerly deallocated ? > > this way, I jumptoo quick on 'too much connection'... > > Emmanuel > > -- > EDENJOB / APR-Job > > Email: [EMAIL PROTECTED]Home:www.apr-job.com > Phone: +33 1 47 81 02 41 Tatoo: +33 6 57 60 42 17 > Fax: +33 1 41 92 91 54 eFAX: +44 0870-122-6748 > > ** > > This message and any attachments (the "message") are confidential > and intended solely for the addressees. > Any unauthorised use or dissemination is prohibited. > E-mails are susceptible to alteration. > Neither EDENJOB/APR-JOB or affiliates shall be liable for the > message if altered, changed or falsified. > > **
Re: Rotating Apache logs
this is off-topic, coz logrotate should do it. man logrotate. rgds, Edwin Terry Newnham wrote: > > Hi > > I've found out how to edit httpd.conf so that it will rotate the error > and access logs. But you have to restart apache to read that which I'd > rather not do. Is there a command-line use or the rotatelogs by means of > which you can rotate the logs on the fly ? > > Terry