Gerald,

I've been giving a lot of thought to the idea of modular web pages 
and "exit" functionality is not nearly as nice as what I think you 
could build into embperl.

The problem is one of trying to create very modular web sites with 
resuable chuncks of code embodied in a web page that calls itself 
for data validation, etc. As an example, I have a page that presents 
some instructions and asks for the user to input their userid, 
password, and email address to create a new userid on the site.  It 
calls upon itself to do the data validation.  When the data is 
validated, it adds the userid to the .htpasswd file.

This userid/password page is a module that I'd like to be able to 
drop into any project that needs this functionality.  Problem with 
exit functionality:

When PageA executes this userid/password page (PageB) and it 
EXIT's at the bottom of the page, it does not return to PageA.  [So 
far so good.  I don't want PageA to be returned to until after the 
validation is done and the userid added.]  Next the user submits 
the data back to PageB. The conditionals in PageB make it so it 
checks the data rather than putting out the form again.  It is 
validated and the user is added to the .htpasswd file. Now the 
problem.  How do I get PageB to return to the line just following the 
calling line from PageA?  This should be just like calling a 
subroutine in Perl it should return to the next line when it's done.

It would be very nice to have Execute handle this with a parameter 
saying "Don't return here until you're told to by the page I'm 
calling".  PageB executes and at the end of PageB it automatically 
stops (like "exit" would do) but it keeps track of where it's 
supposed to return to internally like a regular subroutine would in a 
modular programming language.  When PageB finally executes a 
"return to calling page" command (perhaps passing parameters 
back like perls "return" statement), then and only then would 
PageB actually drop out the bottom and return to PageA.

I realize this is a stateless arena and implementing this would 
require some magic but think Embperl (and you) are able to make 
that kind of magic.  Is this possible or does the stateless nature of 
this make it impossible?  More modularity would be SO nice in this 
environment!

Cordially,
Scott

On 12 Nov 2001, at 10:06, Gerald Richter wrote:

> Scott,
> 
> Andrew have already given an excelent explanation, so there is not much to
> add...
> 
> >
> > Gerald, you want to build this functionality? :-)
> >
> 
> I am not sure which functionality you want to see here ? Just something like
> exit, that does not only exit the current file, but end the whole request ?
> In this case that's something what's on my todo list for 2.0. If you intent
> a more sophisticated thing, please try to explain it again, at the moment I
> understand your problem, but I don't see what EMbperl can do for you in this
> case ?
> 
> Gerald


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to