Hi, I'm new to Apache/mod-perl. I hope I'm asking this question in the right forum.
When I executed a script having " print print "Hello"; " at shell, it returns "Hello1", but when I executed thru mod-perl it returns "Hello5".
CODE SNIPPET:
print "Content-type: text/html\n\n"; print (print "hello");
why is the return value of print is different ?
Guessing that you are using modperl 2.0:
print in mod_perl 2.0 is really $r->print (and implemented via perltie on STDOUT). It returns the number of bytes buffered/sent, not the success or failure. If there is an error it'll croak, so there is no need to check the return value.
http://perl.apache.org/docs/2.0/api/Apache/RequestIO.html#C_print_
I didn't check mod_perl 1.0, but it's probably similar.
In the future when you ask questions here, please first read: http://perl.apache.org/bugs/ and save us the guessing part. Thank you.
-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html