On 25 Sep 2000, Perl6 RFC Librarian wrote:
> =head1 TITLE
>
> First-Class CGI Support
First-class CGI to me means HTML::Embperl. It include a templating
lanaguage for creating HTML/XML pages and support for session management
via cookies.
Are we talking about having cookes close to the core? %COOKIE is there
just like %ENV?
$COOKIE{example} = ['Hello, ', 'World!'];
Could perl6 have features for embeded Perl in the tarball?
Could embedded perl become part of the perl langauge?
#!/usr/bin/perl -cgi
# Set defaults.
$FDAT{first_name} ||= 'Enter first name';
$FDAT{last_name} ||= 'Enter last name';
if ($FDAT{sent}) {
# Process form data.
}
while (<EMBED>) { print }
__EMBED__
<html>
<body>
<form method="POST">
[+ 'Hello, World!' +]<br>
<input name="first_name"><br>
<input name="last_name"><br>
<input name="sent" type="submit">
</form>
</body>
</html>
In the above the hash FDAT is the form data form the POST. The embedding
language does neat things like add value attributes to inputs based on
the contents of %FDAT.
HTML::Embperl is my favorite embedded perl language, but maybe this
could be pluggable.
Alan Gutierrez