You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
(6) |
Jun
(13) |
Jul
(3) |
Aug
(30) |
Sep
(42) |
Oct
(12) |
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
|
Oct
(5) |
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
From: tlm <tl...@gm...> - 2006-04-26 16:55:56
|
Hi! The following question is not strictly about CGIP, but about a problem othe= r users of CGIP may have run into. I'm finding that if I use the standard [% self.CGI.header %] at the top of my templates, Apache disregards the resulting "Content-Type: text/html; charset=3DISO-8859-1" header, and inexplicably sends out Content-Type: application/x-perl which, of course, freaks out the browser. Everything works almost* fine if I stick this print $self->reflect->object->CGI->header; in my render_enter() override, even though the output now includes a duplicated "Content-Type: text/html; charset=3DISO-8859-1" at the top. Thi= s suggests to me that my code is fine, and the problem is with Apache somehow= . Does anyone know why Apache is doing this and/or how to fix it? Thanks! tlm * I say "almost" fine because, of course, the displayed page shows the now superfluous "Content-Type: text/html; charset=3DISO-8859-1" at the top, com= ing from the template. |
From: <me...@st...> - 2006-01-03 23:10:30
|
Just to bring the listeners up to date... The two big projects my clients are requesting with regard to CGI::Prototype are: 1) refactoring CGIP to be more of a plugin architecture, with complete backward compatibility 2) Adding AJAX Yeah, that's right... I'm in the midst of a project that will plug prototype.js (and probably scriptaliscious) into a CGIP framework. Once I have this in place, the oft-rumored "CGIP cookbook" will show how to make web 2.0 apps easily with CGIP. Wheee. More soon. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <me...@st...> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! |
From: <me...@st...> - 2005-12-21 21:33:38
|
>>>>> "Ryan" == Ryan Tate <li...@ry...> writes: Ryan> Actually, I got the message he was replying to on the list as such, Ryan> which you did appear to have Cc-ed. As such it does not appear he Ryan> forwarded a private email (unless I'm missing something big). Sorry, I misoperated my mailreader. I had wanted it to be a private message, but obviously, it's archived at sf.net, so my mistake, I'm sorry. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <me...@st...> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! |
From: Ryan T. <li...@ry...> - 2005-12-21 21:09:39
|
On 20 Dec 2005 09:04:34 -0800, Randal L. Schwartz <me...@st...> w= rote: > I didn't cc the list because I'm coaching you through basic CGI debugging= , > which has nothing to do with CGI::Prototype. Actually, I got the message he was replying to on the list as such, which you did appear to have Cc-ed. As such it does not appear he forwarded a private email (unless I'm missing something big). Orig message below, with headers. Cheers RT X-Gmail-Received: 7ec42ee20b8d7817222ceb8509bef301e8f78e12 Delivered-To: rya...@gm... Received: by 10.37.18.37 with SMTP id v37cs1887nzi; Tue, 20 Dec 2005 00:55:23 -0800 (PST) Received: by 10.54.77.8 with SMTP id z8mr41867wra; Tue, 20 Dec 2005 00:50:05 -0800 (PST) Return-Path: <cgi...@li...> Received: from pop.directnic.com (pop.directnic.com [204.251.10.190]) by mx.gmail.com with SMTP id 45si7157487wri.2005.12.20.00.52.05; Tue, 20 Dec 2005 00:52:06 -0800 (PST) Received-SPF: fail (gmail.com: domain of cgi...@li... does not designate 204.251.10.190 as permitted sender) Received: by pop.directnic.com (iris/0.180:relay); 20 Dec 2005 08:51:49 +00= 00 X-Iris-Envelope-Recipient: <li...@ry...> X-Iris-Envelope-Sender: <cgi...@li...> X-Iris-Host: 1109654241/lists-outbound.sourceforge.net X-Forward: from <li...@ry...> to <rya...@gm...> Received: from lists-outbound.sourceforge.net (EHLO lists-outbound.sourceforge.net) (66.35.250.225) =09by iris2.directnic.com (iris/0.180) with ESMTP =09for <li...@ry...> (rule 769739); 20 Dec 2005 08:51:45 +0000 Return-Path: cgi...@li... Received: from sc8-sf-list1-b.sourceforge.net (sc8-sf-list1-b.sourceforge.net [10.3.1.7]) =09by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP =09id 024BA1270B; Tue, 20 Dec 2005 00:52:03 -0800 (PST) Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=3Dmail.sourceforge.net) =09by sc8-sf-list1.sourceforge.net with esmtp (Exim 4.30) =09id 1EodD7-00038P-1s =09for cgi...@li...; Tue, 20 Dec 2005 00:51:05= -0800 Received: from blue.stonehenge.com ([209.223.236.162] ident=3D_postfix) =09by mail.sourceforge.net with esmtp (Exim 4.44) =09id 1EodD6-00019P-0r =09for cgi...@li...; Tue, 20 Dec 2005 00:51:05= -0800 Received: from localhost (localhost [127.0.0.1]) =09by blue.stonehenge.com (Postfix) with ESMTP id 7771D8F6F5; =09Tue, 20 Dec 2005 00:50:48 -0800 (PST) Received: from blue.stonehenge.com ([127.0.0.1]) =09by localhost (blue.stonehenge.com [127.0.0.1]) (amavisd-new, port 10024) =09with LMTP id 16945-01-22; Tue, 20 Dec 2005 00:50:48 -0800 (PST) Received: by blue.stonehenge.com (Postfix, from userid 1001) =09id 00A6B8F700; Tue, 20 Dec 2005 00:50:47 -0800 (PST) To: benh <ben...@gm...> Received-SPF: pass (lists-outbound.sourceforge.net: domain of cgi...@li... designates 66.35.250.225 as permitted sender) receiver=3Dlists-outbound.sourceforge.net; client_ip=3D66.35.250.225; envelope-from=3Dc...@li...; Cc: cgi...@li... Subject: Re: [cgi-prototype-users] header issue? References: <85d...@ma...> x-mayan-date: Long count =3D 12.19.12.16.2; tzolkin =3D 7 Ik; haab =3D 0 Ka= nkin From: me...@st... (Randal L. Schwartz) In-Reply-To: <85d...@ma...> Message-ID: <86k...@bl...> Lines: 20 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=3Dus-ascii X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by sourceforge.net. =09See http://spamassassin.org/tag/ for more details. =09Report problems to http://sf.net/tracker/?func=3Dadd&group_id=3D1&atid= =3D200001 Sender: cgi...@li... Errors-To: cgi...@li... X-BeenThere: cgi...@li... X-Mailman-Version: 2.0.9-sf.net Precedence: bulk List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users>, =09<mailto:cgi...@li...?subject=3Dunsu= bscribe> List-Id: CGI::Prototype users mailing list <cgi-prototype-users.lists.sourceforge.net> List-Post: <mailto:cgi...@li...> List-Help: <mailto:cgi...@li...?subjec= t=3Dhelp> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users>, =09<mailto:cgi...@li...?subject=3Dsubs= cribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=3Dcgi-pro= totype-users> Date: 20 Dec 2005 00:50:47 -0800 >>>>> "benh" =3D=3D benh <ben...@gm...> writes: benh> started with test.cgi: benh> #!/usr/bin/perl benh> use base CGI::Prototype; benh> main->activate; benh> that throws the header error... benh> so I looked the error up on apache.org benh> (http://httpd.apache.org/docs/1.3/misc/FAQ-F.html#premature-script-he= aders) benh> Thinking that it's an apache issue. Whenever you get an error like that, you need to look at the error log. What does the error log say? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <me...@st...> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl trainin= g! ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log file= s for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick _______________________________________________ cgi-prototype-users mailing list cgi...@li... https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users |
From: <me...@st...> - 2005-12-20 17:04:42
|
>>>>> "benh" == benh <ben...@gm...> writes: benh> [oop! sorry Randal this will be a dupe for you, didn't CC the list ] I didn't cc the list because I'm coaching you through basic CGI debugging, which has nothing to do with CGI::Prototype. It's very NOT COOL for you to take private email and send it back to the list. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <me...@st...> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! |
From: benh <ben...@gm...> - 2005-12-20 08:57:58
|
[oop! sorry Randal this will be a dupe for you, didn't CC the list ] > hay Randal thanks for the module though as stated before the error in > the error log is : > > Premature end of script headers: /home/benh/public_html/beta/test.cgi > > hope this helps. > > benh~ > > > On 20 Dec 2005 00:50:47 -0800, Randal L. Schwartz <me...@st...>= wrote: > > >>>>> "benh" =3D=3D benh <ben...@gm...> writes: > > > > benh> started with test.cgi: > > benh> #!/usr/bin/perl > > benh> use base CGI::Prototype; > > benh> main->activate; > > > > benh> that throws the header error... > > benh> so I looked the error up on apache.org > > benh> (http://httpd.apache.org/docs/1.3/misc/FAQ-F.html#premature-scrip= t-headers) > > benh> Thinking that it's an apache issue. > > > > Whenever you get an error like that, you need to look at the > > error log. What does the error log say? > > > > -- > > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 = 0095 > > <me...@st...> <URL:http://www.stonehenge.com/merlyn/> > > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. > > See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl tra= ining! > > > |
From: <me...@st...> - 2005-12-20 08:51:05
|
>>>>> "benh" == benh <ben...@gm...> writes: benh> started with test.cgi: benh> #!/usr/bin/perl benh> use base CGI::Prototype; benh> main->activate; benh> that throws the header error... benh> so I looked the error up on apache.org benh> (http://httpd.apache.org/docs/1.3/misc/FAQ-F.html#premature-script-headers) benh> Thinking that it's an apache issue. Whenever you get an error like that, you need to look at the error log. What does the error log say? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <me...@st...> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! |
From: benh <ben...@gm...> - 2005-12-20 08:39:57
|
Hello all I'm new to the list, so... umm... hello? Ok heres the issue that I'm having, I keep getting 'Premature end of script headers:' errors when running any CGI::Prototype; app. Heres what I've done. started with test.cgi: #!/usr/bin/perl use base CGI::Prototype; main->activate; that throws the header error... so I looked the error up on apache.org (http://httpd.apache.org/docs/1.3/misc/FAQ-F.html#premature-script-headers) Thinking that it's an apache issue. thinking that I copied something incorrect I ran test.cgi in terminal and got this output: Content-Type: text/html; charset=3DISO-8859-1 This page intentionally left blank. humm... just as expected. So next step was to take that output and just print it via perl: #!/usr/bin/perl print "Content-Type: text/html; charset=3DISO-8859-1 This page intentionally left blank."; And that works? So my question is where did I screw something up? Is this an issue with something on my end (like permissions?) or is this an apache setup issue? Any pointers in the right direction would be very helpful. benh~ |
From: Terrence B. <met...@gm...> - 2005-10-30 06:04:56
|
On 10/29/05, A. Pagaltzis <pag...@gm...> wrote: > > * Randal L. Schwartz <me...@st...> [2005-10-29 16:50]: > > You can probably automate that if you wanted. I'm sure you can > > come up with a BEGIN block that reads the directory and loads > > all the plugins. > > Cf. Module::Pluggable. Yes, also: http://search.cpan.org/~drolsky/Class-Factory-Util-1.6/lib/Class/Factory/Ut= il.pm |
From: A. P. <pag...@gm...> - 2005-10-29 16:06:06
|
* Randal L. Schwartz <me...@st...> [2005-10-29 16:50]: > You can probably automate that if you wanted. I'm sure you can > come up with a BEGIN block that reads the directory and loads > all the plugins. Cf. Module::Pluggable. Regards, -- #Aristotle *AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1}; &Just->another->Perl->hacker; |
From: <me...@st...> - 2005-10-29 14:45:31
|
>>>>> "Terrence" == Terrence Brannon <met...@gm...> writes: Terrence> I just wanted to start a discussion about usage of CGIP in mod_perl Terrence> environments. I am happy with CGIP's setup for my webhosting stuff, because Terrence> we use plain CGI. However, for corporate work (should that day come), the Terrence> fact that the engine slot and the prototype_enter method use autoloads to Terrence> load Template and CGI would compromise performance: one would prefer that Terrence> both of these be loaded eagerly. It would be enough to simply list them literally: use My::App; use My::App::PageOne; use My::App::PageTwo; etc You can probably automate that if you wanted. I'm sure you can come up with a BEGIN block that reads the directory and loads all the plugins. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <me...@st...> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! |
From: Terrence B. <met...@gm...> - 2005-10-29 14:35:49
|
I just wanted to start a discussion about usage of CGIP in mod_perl environments. I am happy with CGIP's setup for my webhosting stuff, because we use plain CGI. However, for corporate work (should that day come), the fact that the engine slot and the prototype_enter method use autoloads to load Template and CGI would compromise performance: one would prefer that both of these be loaded eagerly. So, since there is no class supplied with the CGIP distro by default which handles this (should there be?), I think the approach is obvious: In the startup.pl or whatever pre-loaded handler you will use simply do use Template; use CGI; use base qw(CGI::Prototype); BEGIN { # _reset_globals is discussed here: http://use.perl.org/~merlyn/journal/24641 CGI::_reset_globals(); my $cgi =3D CGI->new } sub engine { my $self =3D shift; # no longer needed: require Template; Template->new($self->engine_config) or die "Creating tt: $Template::ERROR\n"; }); sub CGI { $cgi }); |
From: A. P. <pag...@gm...> - 2005-10-27 16:41:08
|
* Terrence Brannon <met...@gm...> [2005-10-13 23:00]: > I would edit my .bashrc to such a umask if you can tell me what > it is That would be “umask 0002”, or, in bash, the more easily understood “umask g+w”. [ For some reason this message was sitting in my [postponed] folder for a month. ] Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/> |
From: Terrence B. <met...@gm...> - 2005-10-13 20:55:09
|
On 10/13/05, A. Pagaltzis <pag...@gm...> wrote: > Terrence: would you please `chmod -R g+w *` the web site? You > have created a directory and a bunch of files that I can't do > anything with because they only have owner write permission. I did this to the best of my ability - index.html in root is owned by you and I could not chmod it --- it seems that sf.net needs a umask that allows the developers with access to work without these conflicts... I would edit my .bashrc to such a umask if you can tell me what it is |
From: A. P. <pag...@gm...> - 2005-10-13 17:29:51
|
* Randal L. Schwartz <me...@st...> [2005-10-13 14:10]: > For a better "tiny" app, see my Linux Magazine articles (google > site:stonehenge.com CGI::Prototype for the location). Randal: just point people at http://cgi-prototype.sf.net/ – there are links to those articles in the Resources section. Terrence: would you please `chmod -R g+w *` the web site? You have created a directory and a bunch of files that I can’t do anything with because they only have owner write permission. Regards, -- Aristotle Pagaltzis // <http://plasmasturm.org/> |
From: Terrence B. <met...@gm...> - 2005-10-13 12:24:58
|
On 13 Oct 2005 04:58:39 -0700, Randal L. Schwartz <me...@st...> w= rote: > > For a better "tiny" app, see my Linux Magazine articles (google > site:stonehenge.com CGI::Prototype for the location). That location is: http://www.stonehenge.com/merlyn/LinuxMag/col70.html and also 7[12].html |
From: <me...@st...> - 2005-10-13 12:04:45
|
>>>>> "Kai" == Kai Andresen <kai...@gm...> writes: Kai> I copied the My/App test application from the CGI-Prototype Kai> distribution, and added a app.cgi like: Kai> use strict; Kai> use warnings; Kai> use lib qw( /real/path/here ); Kai> use My::App; Kai> My::App->activate; There's no dispatcher in the TestApp. Inheriting the "return $self" from the base class means that you'll stay forever in the "My::App" state, meaning you'll get the "intentionally left blank" message forever. For a better "tiny" app, see my Linux Magazine articles (google site:stonehenge.com CGI::Prototype for the location). -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <me...@st...> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! |
From: Terrence B. <met...@gm...> - 2005-10-12 21:44:06
|
On 10/11/05, Kai Andresen <kai...@gm...> wrote: > Hello, Hi Kai! > > > I copied the My/App test application from the CGI-Prototype > distribution, There's a fully functioning CGI::Prototype app here: http://www.metaperl.org/Guestbook You can download the tarfile and look through it. I can explain it to you step-by-step if you have questions. > and added a app.cgi like: use strict; use warnings; use lib qw( > /real/path/here ); > > use My::App; > My::App->activate; > > ---- > Now, directing the browser to the application brings up the welcome > page, and the source of the page seems ok, form, action, fields and > submit-button and all. Cool... > > > But filling out the form and submitting it, only yields the same page. What did the FORM action attribute action have? > > The only way to get to the thanks-page is to add the parameters into > the url, like http:://localhost/app.cgi?first=3Djohn&last=3Ddoe -> then > I get the nice thank-you-page. Cool... > > > I use this under a recent Cygwin installation, Perl 5.8.7, and lighthttpd > > I obviously miss something fundamental here, but I can't figure it > out, can anyone point me in the right direction? Yes, I think what you are missing is the concept of dispatch. If you look at the activate method in package CGI::Prototype (the easiest way to learn CGIP is to look at the source code), it calls dispatch early on in the activate method. The default dispatch method looks like this: sub dispatch { my $self =3D shift; return $self;=09=09# do nothing, stay here } And so the same page object returning itself is no surprise. In fact, unless you subclass the default dispatch method and specializing it to do certain things with a certain query string parameter (such as rm for runmode), you should never get a different page. If you dont want to handle dispatch yourself, you can use Aristotle's CGI::Prototype::PathInfo, which you can get here: http://prdownloads.sourceforge.net/cgi-prototype/PathInfo.pm?download The dispatch logic is documented in the code. I've also uploaded it to our Sourceforge CVS project but there is a 5-hour delay between anonymous and developer access to cvs updates. |
From: Kai A. <kai...@gm...> - 2005-10-12 16:40:38
|
Hi Terrence, first let me thank you for your time > > There's a fully functioning CGI::Prototype app here: > > http://www.metaperl.org/Guestbook I have already looked at it earlier, and it's nice - I really did not think I had any problems understanding the logic or the relationship between the files. > > and added a app.cgi like: : > > But filling out the form and submitting it, only yields the same page. > > What did the FORM action attribute action have? it has action=3D"http://localhost/test/app.cgi" as appropriate, and method= =3D"post" Also I forgot to mention that the page source validates (i.e. the form is closed). > Yes, I think what you are missing is the concept of dispatch. If you look > at the activate method in package CGI::Prototype (the easiest way to lear= n > CGIP is to look at the source code), it calls dispatch early on in the > activate method. The default dispatch method looks like this: > > sub dispatch { > my $self =3D shift; > return $self; # do nothing, stay here > } No, -well dispatch might be a better place than render_enter for what I know, but the dispatch actually does happen. The problem seems to be that when posted, the params are not seen serverside? app.cgi only uses My/App.pm which extends CGIPH, which defaults to call welcome.pm welcome.pm does dispatch using render_enter where control is transferred to thanks.pm only if both params first and last is available, but that only happens when I set those params in the url.=20 I still don't get why...?? Kai |
From: Kai A. <kai...@gm...> - 2005-10-12 06:41:55
|
Hello, I copied the My/App test application from the CGI-Prototype distribution, and added a app.cgi like: use strict; use warnings; use lib qw( /real/path/here ); use My::App; My::App->activate; ---- Now, directing the browser to the application brings up the welcome page, and the source of the page seems ok, form, action, fields and submit-button and all. But filling out the form and submitting it, only yields the same page. The only way to get to the thanks-page is to add the parameters into the url, like http:://localhost/app.cgi?first=3Djohn&last=3Ddoe -> then I get the nice thank-you-page. I use this under a recent Cygwin installation, Perl 5.8.7, and lighthttpd I obviously miss something fundamental here, but I can't figure it out, can anyone point me in the right direction? Kai |
From: Terrence B. <met...@gm...> - 2005-09-23 07:16:30
|
I moved the CSS out of index.html and into site.css so that this new QA page could have the same look and feel: http://cgi-prototype.sourceforge.net/qa/ I saw a recent question on Perlmonks and decided that it was best to keep links to these questions somewhere. |
From: Terrence B. <ba...@me...> - 2005-09-16 03:25:36
|
I'm happy to say that HTML::Mason has been completely removed from my personal website: http://www.livingcosmos.org/ It was fairly easy to write a subclass of CGIP whose render phase took an HTML file and templated it. I just needed a RewriteRule to push all html files to the CGIP subclass: RewriteRule ^/(.+)[.]s?html$ /cgi-bin/lc.cgi/$1.html [PT] and then I used PATH_TRANSLATED to serve the HTML file: sub dispatch { my $self = shift; my $p = $ENV{PATH_TRANSLATED}; $p =~ s!cgi-bin.+lc.cgi/!!; $self->reflect->addSlot(file_path => $p); $self->pkg_for_path($p) ; } sub pkg_for_path { my ($self, $path) = @_; my $M = Tie::RegexpHash->new; $M->add( qr,vots/index.html, => 'App::vots' ) ; if (my $new_page = $M->match($path)) { eval "require $new_page"; die $@ if $@; warn 'NP', $new_page; $new_page; } else { return $self; } } -- Carter's Compass: I know I'm on the right track when, by deleting something, I'm adding functionality. |
From: Terrence B. <ba...@me...> - 2005-09-14 11:46:38
|
Aristotle, any feedback on my requested patch? > I am using this in my version of PathInfo. There could be some > refactoring to share code with name_to_page, but that's not done right > now. > > =item name_to_pm > > Called with a page name, translates it to a .pm file name, and returns it. > > This module expects page names to look like relative URLs and will translate to > package names like you'd expect, ie assuming the default > C<config_class_prefix>, C<foo/bar> will translate to C<My/App/foo/bar.pm>. > > =cut > > sub name_to_pm { > my $self = shift; > my ( $name ) = @_; > > my $pkg = join '::', ( > $self->config_class_prefix, > split( m{/}, $self->validate_name( $name ) ), > ); > > $pkg =~ s!::!/!g; > > "$pkg.pm"; > } > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf -- Carter's Compass: I know I'm on the right track when, by deleting something, I'm adding functionality. |
From: Terrence B. <ba...@me...> - 2005-09-12 11:37:38
|
"A. Pagaltzis" <pag...@gm...> writes: > * Terrence Brannon <ba...@me...> [2005-09-10 14:35]: >> I am using this in my version of PathInfo. > > What for? it would be nice for you to preserve a bit more context... but anyway, I am needing the name of the .pm file for each resource_type so that I an execute the "view source for this page" link that is on each page. E.g, this link: http://www.metaperl.org/Guestbook/viewsrc/welcome Shows the source that was used for this page: http://www.metaperl.org/Guestbook/welcome |
From: A. P. <pag...@gm...> - 2005-09-10 15:56:00
|
* Terrence Brannon <ba...@me...> [2005-09-10 14:35]: > I am using this in my version of PathInfo. What for? Regards, -- #Aristotle *AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1}; &Just->another->Perl->hacker; |