RE: [RELEASE CANDIDATE] mod_perl-1.31 RC3
Randy Kobes wrote: On Thu, 28 Feb 2008, Issac Goldstand wrote: Steve Hay wrote: Issac Goldstand wrote: win32 (xp sp2, vc6 - no SDK upgrade) - Apache 1.41 binary - ActivePerl 5.10 (build 1002) FAIL (sorry, folks) Segfault at startup. I wonder if this is caused by mis-matched CRTs? ActivePerl is built using VC6 (and therefore uses MSVCRT.dll). You're also using VC6 for mod_perl, but where did that Apache binary come from? What compiler was it built with? Does it work if you build everything yourself from source with the same compiler? I'm reasonably sure that Apache's binaries are still being built with vc6, which is what prompted me to test this particular set of prerequisites (since binary Apache + binary ActivePerl will be the assumed building blocks for a binary PPM package to be installed upon). Bill, am I wrong about the compiler used for the ASF binary release of apache-1.3 win32? I also got a segfault at startup with ActivePerl 1002 (perl-5.10), using an ASF apache binary and VC++ 6. All tests passed with the latest ActivePerl 8xx, based on perl-5.8, using the same Apache binary and compiler. Steve, is your Perl built using the ActivePerl sources, with the same compile-time flags as ActivePerl? No, mine is built from the official 5.10.0 source with my usual configuration changes (USE_MULTI, USE_ITHREADS, USE_IMP_SYS and USE_LARGE_FILES switched off, and PERL_MALLOC and DEBUG_MSTATS switched on).
Re: return DECLINED or OK?
On Fri 29 Feb 2008, J. Peng wrote: btw, mapping uri to disk sources in apache2 was done in MapToStorageHandler rather than Trans handler, is it? The Trans handler's task is to decide which file on disk belongs to a certain URI. So when the Trans handler is done $r-filename must not be empty. Example: the browser asks for /a/b/c/d/e, DocumentRoot is /var/www. Then after the core Trans handler $r-filename would be /var/www/a/b/c/d/e. MapToStorage's task is it then to walk the directory hierarchy, look for .htaccess files, apply configurations and compute $r-path_info based on $r-filename. During this process $r-finfo is filled. Hence, you have to fill it yourself if you change $r-filename after MapToStorage. Example continued: The entry /var/www/a/b exists on disk either as file or as directory but /var/www/a/b/c does not. Then after MapToStorage $r-filename is /var/www/a/b and $r-path_info is /c/d/e. There is another subtle point, the Trans phase can be skipped entirely. This happens for file subrequests. In perl they are created by $r-lookup_file rather than $r-lookup_uri. Such subrequests have an empty $r-uri but a non-empty $r-filename in the first place. And since there is no URI there is nothing to translate. They are quite seldom. If asked I'd instantly know of only one place, mod_negotiation. Torsten
Re: return DECLINED or OK?
On Fri, Feb 29, 2008 at 7:03 PM, Torsten Foertsch [EMAIL PROTECTED] wrote: Example continued: The entry /var/www/a/b exists on disk either as file or as directory but /var/www/a/b/c does not. Then after MapToStorage $r-filename is /var/www/a/b and $r-path_info is /c/d/e. Sorry I can't understand for this. If /var/www/a/b exists but /var/www/a/b/c not, why user requests it? What's $r-path_info? How to get path_info from filename? thanks again.
Re: [RELEASE CANDIDATE] mod_perl-1.31 RC3
Randy, I'm going to start building from scratch using ASF source + AS source, using default compile options, and we'll see where it goes. Have I mentioned lately how much I *hate* bootstrapping CPAN (for prereqs) on Win32? :-p Issac Steve Hay wrote: Randy Kobes wrote: On Thu, 28 Feb 2008, Issac Goldstand wrote: Steve Hay wrote: Issac Goldstand wrote: win32 (xp sp2, vc6 - no SDK upgrade) - Apache 1.41 binary - ActivePerl 5.10 (build 1002) FAIL (sorry, folks) Segfault at startup. I wonder if this is caused by mis-matched CRTs? ActivePerl is built using VC6 (and therefore uses MSVCRT.dll). You're also using VC6 for mod_perl, but where did that Apache binary come from? What compiler was it built with? Does it work if you build everything yourself from source with the same compiler? I'm reasonably sure that Apache's binaries are still being built with vc6, which is what prompted me to test this particular set of prerequisites (since binary Apache + binary ActivePerl will be the assumed building blocks for a binary PPM package to be installed upon). Bill, am I wrong about the compiler used for the ASF binary release of apache-1.3 win32? I also got a segfault at startup with ActivePerl 1002 (perl-5.10), using an ASF apache binary and VC++ 6. All tests passed with the latest ActivePerl 8xx, based on perl-5.8, using the same Apache binary and compiler. Steve, is your Perl built using the ActivePerl sources, with the same compile-time flags as ActivePerl? No, mine is built from the official 5.10.0 source with my usual configuration changes (USE_MULTI, USE_ITHREADS, USE_IMP_SYS and USE_LARGE_FILES switched off, and PERL_MALLOC and DEBUG_MSTATS switched on).
Re: return DECLINED or OK?
On Fri 29 Feb 2008, J. Peng wrote: On Fri, Feb 29, 2008 at 7:03 PM, Torsten Foertsch [EMAIL PROTECTED] wrote: Example continued: The entry /var/www/a/b exists on disk either as file or as directory but /var/www/a/b/c does not. Then after MapToStorage $r-filename is /var/www/a/b and $r-path_info is /c/d/e. Sorry I can't understand for this. If /var/www/a/b exists but /var/www/a/b/c not, why user requests it? What's $r-path_info? How to get path_info from filename? thanks again. Well, then RTFM (http://en.wikipedia.org/wiki/RTFM). Google for CGI and PATH_INFO. Torsten
Re: return DECLINED or OK?
Hi, J. Peng wrote: On Fri, Feb 29, 2008 at 7:03 PM, Torsten Foertsch [EMAIL PROTECTED] wrote: Example continued: The entry /var/www/a/b exists on disk either as file or as directory but /var/www/a/b/c does not. Then after MapToStorage $r-filename is /var/www/a/b and $r-path_info is /c/d/e. Sorry I can't understand for this. If /var/www/a/b exists but /var/www/a/b/c not, why user requests it? What's $r-path_info? How to get path_info from filename? thanks again. I'm not sure if I can help by cutting in here as I'm some what learning Apache and modperl myself. $r is not a file or a filename. This is Perl, remember? :-) So, $r is a scalar variable and, to be precise, the global variable for the Apache RequestRec object. Take a look at: http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html and http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_path_info_ to see what Torsten meant by the path_info. As for /var/www/a/b/c, a user can request for a file that does not exists. The key is what Torsten said about walking the hierarchy. So, if /var/www/a/b/c/d/e does not exist, it sees if /var/www/a/b/c/d exists. If not, it tries /var/www/a/b/c/. It continues doing this, walking [up] the hierarchy, until it finds a match. In Torsten's example, this would be: /var/www/a/b/ Then, the RequestRec object now stores two parts. A filename /var/www/a/b/ and a path_info /c/d/e. Why would you want to do that. Well, an example that I saw in the Mason Book (Note: don't confuse yourself with learning this right now, but I just want to mention where I got the example from) which helped me understand this was as follows. Say you have a news site like: http://example.com/archive/news/2008/02/29/index.html A user might request that, but it wouldn't make sense to have 365 index.html's every year (ok, 366 this year :-) ). Instead, you could do a trick above and keep going up the hierarchy until you have a filename /var/www/archive/news/ and a path_info /2008/02/29/index.html. You can then use the path_info as a query string to some database to retrieve today's news. i.e., you don't actually have a file sitting at: /var/www/archive/news/2008/02/29/index.html but the user doesn't know this and probably doesn't care as long as s/he can see today's news. I hope this helps and I hope I didn't mess up your example, Torsten. If so, please correct me for my benefit, as well! :-) Ray
Re: return DECLINED or OK?
On Fri 29 Feb 2008, Raymond Wan wrote: It continues doing this, walking [up] the hierarchy, until it finds a match. Don't know what you mean by up. AFAIK it walks in this order: / /var /var/www /var/www/a /var/www/a/b For me that would be down, ;-) Torsten
Re: return DECLINED or OK?
On Fri, Feb 29, 2008 at 8:13 PM, Raymond Wan [EMAIL PROTECTED] wrote: Say you have a news site like: http://example.com/archive/news/2008/02/29/index.html A user might request that, but it wouldn't make sense to have 365 index.html's every year (ok, 366 this year :-) ). Instead, you could do a trick above and keep going up the hierarchy until you have a filename /var/www/archive/news/ and a path_info /2008/02/29/index.html. Do you mean mod_rewrite for the trick? yes with mod_rewrite people can rewrite: http://example.com/archive/news/2008/02/29/index.html to something like: http://example.com/archive/news?object=/2008/02/29/index.html so here /archive/news is filename and /2008/02/29/index.html is path_info,is it? But in this case we don't need to guess the path_info from filename, just saying $r-param() can get the arguments,:) Thanks.
Re: return DECLINED or OK?
J. Peng wrote: On Fri, Feb 29, 2008 at 8:13 PM, Raymond Wan [EMAIL PROTECTED] wrote: Say you have a news site like: http://example.com/archive/news/2008/02/29/index.html A user might request that, but it wouldn't make sense to have 365 index.html's every year (ok, 366 this year :-) ). Instead, you could do a trick above and keep going up the hierarchy until you have a filename /var/www/archive/news/ and a path_info /2008/02/29/index.html. Do you mean mod_rewrite for the trick? What he's saying is that you don't need mod_rewrite for this kind of thing. It's pretty standard for REST applications to use the path_info to determine which resource to return. Or you could do it with mod_rewrite, but using the path_info can provide for a lot more flexibility. -- Michael Peters Plus Three, LP
Re: return DECLINED or OK?
On Fri, Feb 29, 2008 at 9:52 PM, Raymond Wan [EMAIL PROTECTED] wrote: I think you'll pick it up in time and one starting point is to write some sample code and try things out... I have written lots of modperl codes actually,:) But I primarilly write with AccessHandler or ResponseHandler, didn't do any TransHandler coding. Most website products use only ResponseHandler. Just googled and know what's path_info now. It's an odd concept I think.Anyway thanks. //joy
Re: return DECLINED or OK?
J. Peng wrote: Do you mean mod_rewrite for the trick? yes with mod_rewrite people can rewrite: http://example.com/archive/news/2008/02/29/index.html to something like: http://example.com/archive/news?object=/2008/02/29/index.html so here /archive/news is filename and /2008/02/29/index.html is path_info,is it? But in this case we don't need to guess the path_info from filename, just saying $r-param() can get the arguments,:) No, that's not what I meant and I also wasn't aware of mod_rewrite. :-) Might I make a suggestion? It seems this discussion has moved quite beyond the original subject. This (in my humble opinion) is not something you learn in a day. Well, I certainly didn't. I think you'll pick it up in time and one starting point is to write some sample code and try things out... Ray
Re: Amazon
On Feb 26, 2008, at 8:29 PM, J. Peng wrote: coding from perl to python is easy,at least it's easy for me. but,as many guys have said to me, from python to perl is not easy. perl's many features,like the rich built-in variables and context,are not so easy to be accetable by newbies. I think the big issue in going from python-perl is losing the formatting and whitespace. i went from perl-python -- which was dead simple -- and occasionally bring in python friends to help with perl stuff. the only things they groan about are differences with the idiomatic ways to accomplish tasks, and using curly brackets On Feb 26, 2008, at 9:06 AM, David Scott wrote: I've seen that too. Some engineering managers have an absolute phobia when it comes to Perl. But some of these same managers turn right around and extol the virtues of Ruby. Go figure. As far as I can tell, beyond a lot of syntactic sugar the two are virtually indistinguishable - except that Perl has been around longer and runs a lot deeper. Same with Python. Perl is known as messy. Ruby is known as clean. I'd say ruby is messier than Perl, but has had 1000x more marketing materials pushed its way because of Rails. I've seen too many CEOs and CTO/Tech-Directors make decisions based on this: how many more people are talking about ruby than perl? i see a lot more ruby jobs right now. ruby is getting a big rise in usage, perl has plateaued there are big web conferences, and fancy web 2.0 sites done in ruby Anyone on this list could give very eloquent reasons as to why that line of reasoning is flawed, and show each argument as being incorrect. The point is that people are making decisions based on questions like that. I think a lot of the debate boils down to culture. Perl people tend to come from a sysadmin culture and are more comfortable working where the rubber hits the road. PHP people tend to come from web dev, and really don't see the need to go too far beyond dynamic web pages. Ruby and Python people tend to be Java refugees. I'd disagree with that a bit. PHP and Ruby both have their root in 'web dev', but their core audience is more like this: they did java in web 1.0 because it was the next big thing with all the jobs they moved to php, because it was the new big thing that people were hiring for they moved again to ruby, because it was the new big thing that people are hiring for i see SO many resumes that show 'java-php-ruby' -- and friends who run companies have seen the same. whenever we see that, we pretty much toss the resume -- those people aren't engineers or thinkers, they're basically code monkeys who are trading on the current in-demand language. Also, most people I see in python come from all over - lots of Perl and Java , some php, and a lot of C - they're looking more or less to do rapid prototyping of apps they either want to scale one day, or will re-write in c. I see this group less as refugees, as they often maintain their other languages. Probably 60% of the python devs I know will often write C- libraries to handle issues or are starting to offload onto Erlang. But the skill set involved in writing good code is no different, regardless of your background. That is 100% true. A good person can shift languages in a heartbeat. The languages all have their strengths and weaknesses, but are mostly just syntax and approach differences. The good engineers know how to solve problems, with fundamentals and creativity - not a languag.
RE: return DECLINED or OK?
I learned what is RTFM here which is very interesting :)...I like the Ubuntu Forums policy though...but I always think reading is helpful to any developer...that's why I like both perl and java because I think they are very well documented generously somewhere within my reach on the net -Original Message- From: J. Peng [mailto:[EMAIL PROTECTED] Sent: Friday, February 29, 2008 9:12 AM To: Raymond Wan Cc: modperl@perl.apache.org Subject: Re: return DECLINED or OK? On Fri, Feb 29, 2008 at 9:52 PM, Raymond Wan [EMAIL PROTECTED] wrote: I think you'll pick it up in time and one starting point is to write some sample code and try things out... I have written lots of modperl codes actually,:) But I primarilly write with AccessHandler or ResponseHandler, didn't do any TransHandler coding. Most website products use only ResponseHandler. Just googled and know what's path_info now. It's an odd concept I think.Anyway thanks. //joy
Modperl: modperl-2.0_20080229115113 Make fail w/ missing runtime defs plus t/apr/finfo and vhost/config errors
-8-- Start Bug Report 8-- 1. Problem Description: I'm on AIX 5.3. I used snapsot modperl-2.0_20080229115113. I'm failing in the make test where get a rtld:0712-001 where symbols are referenced but no runtime definition is found. I've run into a similar error when compiling mod_ssl where is says its missing symbol main. I tried the verbose test but nothing more was displayed than in the normal test log ( bottom of page ). There were however two other tests where I did include the verbose as it was relevent. Please let me know if more info is needed or what I might try! Test Summary ( again details under the bug report ) Test Summary Report --- t/apr-ext/brigade.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/apr-ext/bucket.t(Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/apr-ext/error.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/apr-ext/finfo.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/apr-ext/perlio.t(Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/apr-ext/pool.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/apr-ext/table.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/apr-ext/threadmutex.t (Wstat: 65280 Tests: 3 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 5 tests but ran 3. t/apr-ext/uri.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/apr/finfo.t (Wstat: 0 Tests: 28 Failed: 2) Failed tests: 3, 17 t/vhost/config.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output Files=244, Tests=2228, 601 wallclock secs ( 3.78 usr 3.28 sys + 141.75 cusr 35.53 csys = 184.34 CPU) Result: FAIL Failed 11/244 test programs. 2/2228 subtests failed. [warning] server localhost:8529 shutdown 2. Used Components and their Configuration: *** mod_perl version 2.03 *** using /home/users/webownr/source/mod_perl-2.0.3/lib/Apache2/BuildConfig.pm *** Makefile.PL options: MP_APR_LIB = aprext MP_APXS= /web/apache/production/bin/apxs MP_COMPAT_1X = 1 MP_GENERATE_XS = 1 MP_LIBNAME = mod_perl MP_USE_DSO = 1 *** /web/apache/production/bin/httpd -V Server version: Apache/2.2.8 (Unix) Server built: Feb 28 2008 13:43:47 Server's Module Magic Number: 20051115:11 Server loaded: APR 1.2.12, APR-Util 1.2.12 Compiled using: APR 1.2.12, APR-Util 1.2.12 Architecture: 64-bit Server MPM: Prefork threaded: no forked: yes (variable process count) Server compiled with -D APACHE_MPM_DIR=server/mpm/prefork -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=128 -D HTTPD_ROOT=/web/apache/production -D SUEXEC_BIN=/web/apache/production/bin/suexec -D DEFAULT_PIDLOG=logs/httpd.pid -D DEFAULT_SCOREBOARD=logs/apache_runtime_status -D DEFAULT_LOCKFILE=logs/accept.lock -D DEFAULT_ERRORLOG=logs/error_log -D AP_TYPES_CONFIG_FILE=conf/mime.types -D SERVER_CONFIG_FILE=conf/httpd.conf *** /usr/bin/ldd /web/apache/production/bin/httpd /web/apache/production/bin/httpd needs: /web/apache/production/lib/libaprutil-1.so /web/apache/production/lib/libapr-1.so /apps/support/packages/lib/libz.so /usr/lib/libpthread.a(shr_xpg5_64.o) /usr/lib/libc.a(shr_64.o) /apps/support/packages/lib/libexpat.a(libexpat.so.1) /usr/lib/libiconv.a(shr4_64.o) /unix /usr/lib/libcrypt.a(shr_64.o) *** (apr|apu)-config linking info -L/web/apache/production/lib -laprutil-1 -lexpat -liconv -L/apps/support/packages/lib -L/web/apache/production/lib -lapr-1 -lpthread -Wl,-brtl *** /usr/opt/perl5/bin/perl -V Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration: Platform: osname=aix, osvers=5.2.0.0, archname=aix-thread-multi uname='aix perlfly 2 5 000ad7df4c00 ' config_args='' hint=previous, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n,
Re: Amazon
On this portion of your email: But the skill set involved in writing good code is no different, regardless of your background. That is 100% true. A good person can shift languages in a heartbeat. The languages all have their strengths and weaknesses, but are mostly just syntax and approach differences. The good engineers know how to solve problems, with fundamentals and creativity - not a languag. Yes. Syntactically it is somewhat easy to move from language to language. I think though that the real power of productivity is in the use and availability of libraries available for a given language. The CPAN archive is tremendous, and has given me so much power using perl and mod-perl, that I have pretty much built a career on it. I hope and don't plan to ever give it up because some manager reads the buzz in the publications. Ruby is somewhat enticing because of the buzz, but love your point about program language hoppers. I might try a new language, do some of the basic stuff, but then just say, can do it in perl - better, quicker, easier. Basically, the languages are just tools to express oneself. But if perl can do most everything I need, better to keep up with the web2.0 stuff, and not just work on another reinvented wheel of a programming language. Of course, I have been using perl for 15+ years, so it has become a trusted friend. Yes, the real value is in the creative power of the designer/programmer, and not just remembering syntax. Jonathan Vanasco [EMAIL PROTECTED] wrote on 02/29/2008 11:17:14 AM: On Feb 26, 2008, at 8:29 PM, J. Peng wrote: coding from perl to python is easy,at least it's easy for me. but,as many guys have said to me, from python to perl is not easy. perl's many features,like the rich built-in variables and context,are not so easy to be accetable by newbies. I think the big issue in going from python-perl is losing the formatting and whitespace. i went from perl-python -- which was dead simple -- and occasionally bring in python friends to help with perl stuff. the only things they groan about are differences with the idiomatic ways to accomplish tasks, and using curly brackets On Feb 26, 2008, at 9:06 AM, David Scott wrote: I've seen that too. Some engineering managers have an absolute phobia when it comes to Perl. But some of these same managers turn right around and extol the virtues of Ruby. Go figure. As far as I can tell, beyond a lot of syntactic sugar the two are virtually indistinguishable - except that Perl has been around longer and runs a lot deeper. Same with Python. Perl is known as messy. Ruby is known as clean. I'd say ruby is messier than Perl, but has had 1000x more marketing materials pushed its way because of Rails. I've seen too many CEOs and CTO/Tech-Directors make decisions based on this: how many more people are talking about ruby than perl? i see a lot more ruby jobs right now. ruby is getting a big rise in usage, perl has plateaued there are big web conferences, and fancy web 2.0 sites done in ruby Anyone on this list could give very eloquent reasons as to why that line of reasoning is flawed, and show each argument as being incorrect. The point is that people are making decisions based on questions like that. I think a lot of the debate boils down to culture. Perl people tend to come from a sysadmin culture and are more comfortable working where the rubber hits the road. PHP people tend to come from web dev, and really don't see the need to go too far beyond dynamic web pages. Ruby and Python people tend to be Java refugees. I'd disagree with that a bit. PHP and Ruby both have their root in 'web dev', but their core audience is more like this: they did java in web 1.0 because it was the next big thing with all the jobs they moved to php, because it was the new big thing that people were hiring for they moved again to ruby, because it was the new big thing that people are hiring for i see SO many resumes that show 'java-php-ruby' -- and friends who run companies have seen the same. whenever we see that, we pretty much toss the resume -- those people aren't engineers or thinkers, they're basically code monkeys who are trading on the current in-demand language. Also, most people I see in python come from all over - lots of Perl and Java , some php, and a lot of C - they're looking more or less to do rapid prototyping of apps they either want to scale one day, or will re-write in c. I see this group less as refugees, as they often maintain their other languages. Probably 60% of the python devs I know will often write C- libraries to handle issues or are starting to offload onto Erlang. But the skill set involved in writing good code is no different, regardless of your background. That is 100% true. A good person can shift languages in a heartbeat. The languages all have their strengths and weaknesses, but are mostly
Re: MapToStorage and the use of path_info (was Re: return DECLINED...)
Hi Frank, Frank Maas wrote: I am using a mechanism where I use the path_info to carry information about the content to be served. However, as far as I know the only way to do this is to create a handler that is defined for the correct location. In the described situation, something like, I have to confess that as I learned Mason first, I have problems separating it from modperl. So, how one would do it the modperl (only) way is something that I probably can't put into words and if I did, I probably would get it wrong. So, I'll have to let someone else answer you...sorry! The Mason way (and my news example) was taken from here: http://www.masonbook.com/book/chapter-3.mhtml#TOC-ANCHOR-8 And this is in fact something that I am doing on my site to move up [or down :-) ] it, but not with news. As Mason is used for templating, the Mason way could be the same as the modperl way. If you want to know the details of the Mason way, you can read that chapter, but this book seems out-dated and relevant to modperl 1. Sorry I cannot be of more help! Ray
ANNOUNCE: Apache::AuthCookie, Apache2::AuthCookie 3.11
The uploaded file Apache-AuthCookie-3.11.tar.gz has entered CPAN as file: $CPAN/authors/id/M/MS/MSCHOUT/Apache-AuthCookie-3.11.tar.gz size: 35827 bytes md5: 536ad77c61eaafe1ef152ccdfcdbdbd2 Changes: Version: 3.11 - Fix tiny pod doc error. - Escape CR and LF in 'destination' field to prevent possible XSS attack [Steffen Schwigon]
Re: MapToStorage and the use of path_info (was Re: return DECLINED...)
On Fri 29 Feb 2008, Frank Maas wrote: I am using a mechanism where I use the path_info to carry information about the content to be served. However, as far as I know the only way to do this is to create a handler that is defined for the correct location. In the described situation, something like, Location /archive/news PerlHandler MyNews-handler() /Location I do not see how MapToStorage handler will help here. There probably is no /var/www/archive/news file (or directory), and even if there is, it is of no use to Apache. Or am I completely and utterly mistaken here? Your confusion comes from the fact that you look at it through mod_perl spectacles where you don't necessarily have a corresponding disk file. But Apache is made chiefly to ship files. So in the m2s phase apache splits the filename it gets from trans into the name of a filesystem entry and the trailing path_info. If you have a CGI script say /bin/x.cgi that is located in /www/cgi-bin/x.cgi and you call it as /bin/x.cgi/path/info then after trans filename points to /www/cgi-bin/x.cgi/path/info. m2s then finds that /www/cgi-bin/x.cgi is a regular file. So it sets filename to /www/cgi-bin/x.cgi and path_info to /path/info. So in CGI context you can be certain that PATH_INFO is the remainder of the URI after the current script is stripped off. BTW, the default response handler the one that ships files returns 404 if path_info is not empty. Now in mod_perl you normally don't have a disk file. You have a compiled handler. So m2s will determine the start of path_info somewhere in the URI where it finds the last existing directory. Hence when using a modperl handler don't rely on path_info. By creating an additional directory or deleting one you can spoil your logic! That is called action at a distance. Use $r-uri and $r-location instead. Don't use LocationMatch in this case. Then the first part of $r-uri equals to $r-location. So you can compute a mod_perl version of path_info as substr($r-uri, length($r-location)). This one doesn't depend on existing or non-existing filesystem entries. Torsten
Re: return DECLINED or OK?
Ronald Dai. wrote: I learned what is RTFM here which is very interesting :)...I like the Ubuntu Forums policy though...but I always think reading is helpful to any developer...that's why I like both perl and java because I think they are very well documented generously somewhere within my reach on the net Learning how to effectively RTFM is an essential skill for anyone, in any walk of life, in any industry. IMHO, the Ubuntu policy is too fluffy. People will never learn to think for themselves if their hands are held all the time. Then again, that's sort of Ubuntu's market these days, I guess. I've been telling people to RTFM for a long time, and I've never known anyone to become a worse developer or user for it. Colin
RE: return DECLINED or OK?
Actually RTFM would not be a problem for people from academic background (meaning MS or PHD educated) at all since they have to do it all the timebut for people with more team work background these days, it might not be politically very correct... -Original Message- From: Colin Wetherbee [mailto:[EMAIL PROTECTED] Sent: Friday, February 29, 2008 3:49 PM To: Ronald Dai. Cc: J. Peng; Raymond Wan; modperl@perl.apache.org Subject: Re: return DECLINED or OK? Ronald Dai. wrote: I learned what is RTFM here which is very interesting :)...I like the Ubuntu Forums policy though...but I always think reading is helpful to any developer...that's why I like both perl and java because I think they are very well documented generously somewhere within my reach on the net Learning how to effectively RTFM is an essential skill for anyone, in any walk of life, in any industry. IMHO, the Ubuntu policy is too fluffy. People will never learn to think for themselves if their hands are held all the time. Then again, that's sort of Ubuntu's market these days, I guess. I've been telling people to RTFM for a long time, and I've never known anyone to become a worse developer or user for it. Colin
Re: return DECLINED or OK?
Ronald Dai. wrote: Actually RTFM would not be a problem for people from academic background (meaning MS or PHD educated) at all since they have to do it all the timebut for people with more team work background these days, it might not be politically very correct... I disagree. Granted, I have a master's degree. But, let's say, as very nearly happened on another mailing list yesterday, someone installs database software and can't figure out how to create a database. I say go look at the manual and here's the specific URL that covers creating new databases. Now, that person knows where to look for information about creating a database, *and* that person also knows where to look for answers to future simple questions. If I had only told that person to type createdb your_database_name, the manual never would have been involved, and that person would have emailed the list again for the next basic question that could have been answered by the manual. I didn't say RTFM in so many words (or letters), but the point was to give the user some reference material. Which, so far, seems to have worked. Colin
RE: return DECLINED or OK?
Well I don't feel you are disagreeing meon the contrary I feel we are talking about the same thingpersonally I have been used to reading manuals, references, specs since I was still in academic field however, when I was mentioning today's team work culture I was kind referring to a culture by and large.today when you go for an interview, or when you take a professional test, you will not be gauged for how much you can do your job independently based on manuals, references,the only thing you are gauged for is how much syntaxes you remember at that momentI even had an experience with someone interviewing me asking me questions about formulas while himself was reading from a textbook in his hand, which means he was trying to test me for something obviously he was not qualified himself! Thanks Ron -Original Message- From: Colin Wetherbee [mailto:[EMAIL PROTECTED] Sent: Friday, February 29, 2008 4:04 PM To: Ronald Dai. Cc: modperl@perl.apache.org Subject: Re: return DECLINED or OK? Ronald Dai. wrote: Actually RTFM would not be a problem for people from academic background (meaning MS or PHD educated) at all since they have to do it all the timebut for people with more team work background these days, it might not be politically very correct... I disagree. Granted, I have a master's degree. But, let's say, as very nearly happened on another mailing list yesterday, someone installs database software and can't figure out how to create a database. I say go look at the manual and here's the specific URL that covers creating new databases. Now, that person knows where to look for information about creating a database, *and* that person also knows where to look for answers to future simple questions. If I had only told that person to type createdb your_database_name, the manual never would have been involved, and that person would have emailed the list again for the next basic question that could have been answered by the manual. I didn't say RTFM in so many words (or letters), but the point was to give the user some reference material. Which, so far, seems to have worked. Colin
Re: return DECLINED or OK? [off-topic]
Colin Wetherbee wrote: Ronald Dai. wrote: Actually RTFM would not be a problem for people from academic background (meaning MS or PHD educated) at all since they have to do it all the timebut for people with more team work background these days, it might not be politically very correct... I disagree. Granted, I have a master's degree. I should point out that one could be educated without a MS or a PhD. One could also be uneducated with a MS and/or a PhD. It depends on one's quality of education and their self-motivation in RTFM. But I know that Ronald is saying it casually, just like the expression being a rocket scientist which is probably an out-dated expression now. But, let's say, as very nearly happened on another mailing list yesterday, someone installs database software and can't figure out how to create a database. I say go look at the manual and here's the specific URL that covers creating new databases. Now, that person knows where to look for information about creating a database, *and* that person also knows where to look for answers to future simple questions. I totally agree with this and I think that one has to know the material before working as a group. Some university courses are so caught up in the terminology like team work, they seem to jump a step. Just like it would be good to learn how to add before you can use a calculator. Yes, everyone nowadays uses a calculator -- it is in high school curriculum now and it is also the real world -- but strange to focus on the calculator if someone does not even know how to do the operations that a calculator does... Ray
Re: MapToStorage and the use of path_info (was Re: return DECLINED...)
I'm still confused why we need a path_info for the additional info to CGI/modperl scripts? Generally under CGI we say x.cgi?key=value to pass arguments, under modperl handler we say /myHandler/?key=value to do it, or using POST method. Under what case we use path_info? //joy On Sat, Mar 1, 2008 at 3:22 AM, Torsten Foertsch [EMAIL PROTECTED] wrote: On Fri 29 Feb 2008, Frank Maas wrote: I am using a mechanism where I use the path_info to carry information about the content to be served. However, as far as I know the only way to do this is to create a handler that is defined for the correct location. In the described situation, something like, Location /archive/news PerlHandler MyNews-handler() /Location I do not see how MapToStorage handler will help here. There probably is no /var/www/archive/news file (or directory), and even if there is, it is of no use to Apache. Or am I completely and utterly mistaken here? Your confusion comes from the fact that you look at it through mod_perl spectacles where you don't necessarily have a corresponding disk file. But Apache is made chiefly to ship files. So in the m2s phase apache splits the filename it gets from trans into the name of a filesystem entry and the trailing path_info. If you have a CGI script say /bin/x.cgi that is located in /www/cgi-bin/x.cgi and you call it as /bin/x.cgi/path/info then after trans filename points to /www/cgi-bin/x.cgi/path/info. m2s then finds that /www/cgi-bin/x.cgi is a regular file. So it sets filename to /www/cgi-bin/x.cgi and path_info to /path/info. So in CGI context you can be certain that PATH_INFO is the remainder of the URI after the current script is stripped off. BTW, the default response handler the one that ships files returns 404 if path_info is not empty. Now in mod_perl you normally don't have a disk file. You have a compiled handler. So m2s will determine the start of path_info somewhere in the URI where it finds the last existing directory. Hence when using a modperl handler don't rely on path_info. By creating an additional directory or deleting one you can spoil your logic! That is called action at a distance. Use $r-uri and $r-location instead. Don't use LocationMatch in this case. Then the first part of $r-uri equals to $r-location. So you can compute a mod_perl version of path_info as substr($r-uri, length($r-location)). This one doesn't depend on existing or non-existing filesystem entries. Torsten
Re: return DECLINED or OK?
J. Peng [EMAIL PROTECTED] writes: On Fri, Feb 29, 2008 at 7:03 PM, Torsten Foertsch [EMAIL PROTECTED] wrote: Example continued: The entry /var/www/a/b exists on disk either as file or as directory but /var/www/a/b/c does not. Then after MapToStorage $r-filename is /var/www/a/b and $r-path_info is /c/d/e. Sorry I can't understand for this. If /var/www/a/b exists but /var/www/a/b/c not, why user requests it? What's $r-path_info? How to get path_info from filename? thanks again. Hello, If /var/www/a/b is a script of some kind, then it will be executed with $r-path_info set to '/c'. This is another way of passing parameters into a script, and it's preferred sometimes because it looks more natural in a URL. Hope this helps, -Scott.
Re: MapToStorage and the use of path_info (was Re: return DECLINED...)
Joy, J. Peng wrote: I'm still confused why we need a path_info for the additional info to CGI/modperl scripts? Generally under CGI we say x.cgi?key=value to pass arguments, under modperl handler we say /myHandler/?key=value to do it, or using POST method. Under what case we use path_info? How about this for an explanation. In the first scenario with the ?, you are passing arguments explicitly using key/value pairs as if it was part of the URL sent by the web browser. In the second scenario, nothing is being passed as key/value pairs. Instead, the server searches up/down the directory hierarchy until it finds a match and everything after the match becomes the argument. In the first scenario when you are splitting the path into key/value, you need to know where to split it. How? Perhaps by doing a file test with each split yourself? In the second case, you don't need to worry about it. Not a very technical answer, but maybe an easy way of thinking of things. The second scenario also makes it possible for Google, etc. to index your web pages since it is a real URL. In the first case, it is possible, but not as straight-forward. Ray
Re: MapToStorage and the use of path_info (was Re: return DECLINED...)
On Sat, Mar 1, 2008 at 1:37 PM, Raymond Wan [EMAIL PROTECTED] wrote: Not a very technical answer, but maybe an easy way of thinking of things. The second scenario also makes it possible for Google, etc. to index your web pages since it is a real URL. In the first case, it is possible, but not as straight-forward. oh, it's good that I learned another way to request an uri with the path_info way. yes the path_info uri is good to be recorded by google, since it looks doesn't like a dynamic page. for us we generally use mod_rewrite to rewrite a dynamic page to seem like a static page,like: RewriteRule ^/myspace/my(\d+).html /myspace/index.cgi?id=$1 thanks. //joy