Re: the CGI.pm in Perl 6

2006-09-21 Thread Juerd
Larry Wall skribis 2006-09-20 16:34 (-0700):
 That should work but my preference is just
 my @bar = $q.parambar[];
 That is, empty .[] has the same arrayifying semantics as @.  (This is
 currently b0rken in pugs though.)  Likewise .{} is equivalen to %.

Nice, but what's the syntax for an empty slice then?
-- 
korajn salutojn,

  juerd waalboer:  perl hacker  [EMAIL PROTECTED]  http://juerd.nl/sig
  convolution: ict solutions and consultancy [EMAIL PROTECTED]


Re: CGI Session management (was Re: the CGI.pm in Perl 6)

2006-09-21 Thread Juerd
Aankhen skribis 2006-09-20 18:32 (-0700):
 If those are modules to generate markup, I don't see why they should
 under the Web namespace.  There needs to be a Web.pm toolkit (or
 something similar), but that's mostly an amalgamation of other
 modules.

Because they speak the same language. That is: they know about arguments
passed via forms, and the preferred output language (xhtml? html?).

use Web :typexhtml :html $web;
...;
print img(...);   # img .../

I'm dreaming that :typexhtml does the following things:

1. Set the MIME-type to application/xhtml+xml
2. Set the output encoding to UTF-8 again, because application/*
   implied raw
3. Make begin_html (or whatever it'll be called) smart enough to
   output the correct XML header doctype too
4. Make all html generation methods (requested with :html in my
   example. Should perhaps be renamed to :htmlgen?) output XHTML
   compatible tags.

If Web::HTML (Web::HTMLgen) is a role to Web, all this can come
naturally. If it's a module somewhere else, it's not so obvious that
it'll play nicely with the rest. 

Putting it in the Web namespace, and making it use information from the
Web object (which mostly delegates to its .request and .response),
doesn't have to mean it can't be used stand-alone.
-- 
korajn salutojn,

  juerd waalboer:  perl hacker  [EMAIL PROTECTED]  http://juerd.nl/sig
  convolution: ict solutions and consultancy [EMAIL PROTECTED]


Re: CGI Session management (was Re: the CGI.pm in Perl 6)

2006-09-21 Thread Fagyal Csongor

Randal L. Schwartz wrote:


Fagyal == Fagyal Csongor [EMAIL PROTECTED] writes:
   



Fagyal As a side note I also have to add that I really dislike the
Fagyal html-functions CGI.pm currently has. Creating the representation is
Fagyal the task of the designer, not the programmer. It's almost like echo
Fagyal in PHP :))) I used CGI.pm with simple cgi scripts, with Apache::ASP,
Fagyal mod_perl and FCGI, I used CGI::Cookie, etc. yet I never needed those
Fagyal HTML generating methods. To me, imhoit feels wrong that they are
Fagyal there/imho.

You've never made a sticky form then.


Erm... what makes you think so?

Not with CGI.pm, but I use HTML::FillInForm for the basic cases (which 
is simply a per-page config parameter in my framework, and which has the 
advantage of using simple HTML markup without any coding), and my own 
module (PET::Filter::UtilXmlMap) for more comples cases when forms are 
pre-populated from DB. E.g.:


ehtml:bodySelect array=subst.pages name=page selected=QUERY.page /

(Note: this generates [% Util.ehtml.bodySelect('array', subst.pages, 
'name', 'page', selected, QUERY.page %] at compile time.)


I think JSP tag libraries had a too strong effect on me :)

- Fagzal