Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chaoticset (2105)

  (email not shown publicly)
AOL IM: chaoticset23 (Add Buddy, Send Message)
Yahoo! ID: illuminatus_foil (Add User, Send Message)

JAPH. (That's right -- I'm not Really Inexperienced any more.)

I'm not just here, I'm here [], and here [] too, I ramble randomly in my philosophical blog [] and my other blog []. Soon I'll come in a convenient six-pack.

Journal of chaoticset (2105)

Thursday July 18, 2002
11:40 AM

First Fresh Look

[ #6457 ]
Back up all the working things so I don't accidentally gut the code, start examining the JS insertion process...

belg4mit posted a regex that would swap submit HTML into a button with a JS function call. I'm not dealing directly with HTML except in the template for HTML::Template, though. (Nothing against belg4mit, because I was very vague about this all in the last post.)

No more vagaries; I'm going to lay it out here.

The script uses the state mechanism from the Cookbook (a hash associating names of states to subrefs for those states). State is determined by another sub, which checks for a valid password, valid session, and what state was desired; if the state desired requires a valid user, and there's no valid user, it defaults.

The code is all handled with short subs that I call CGI from; that code is called from the state sub and sometimes from the specific state subs themselves.

I've tried to get to the point that I don't have to call CGI directly any more, and I've pretty much succeeded. (I was using CGI for quick debugging, printing a header and some variable's contents, but I've actually written in specific debug routines and a section of the HTML::Template calls specifically produce debug info at the end of the generated page.)

I'll look at it again after a cup of strong tea. I was hoping to create a single simple JS call (the ONSUBMIT="") so I wouldn't have to go digging around in this crap again, but it looks like that may be too limited. belg's solution may be the right one: JS calls for individual submit functions.

Then again, perhaps I just haven't had enough caffeine. I'll look at all this again with a strong cup of tea by my side, and report if something significant crops up (like actual coding).

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.