|Perl: the Markov chain saw|
Re: Re (tilly) 2: CGI.pm for HTML output?by shotgunefx (Parson)
|on Mar 09, 2002 at 16:12 UTC||Need Help??|
While for general purposes I would agree, but I do consider myself I good (not great) perl programmer
and I've found one really nice use.
Now when the user submits, the module knows that it needs a a parameter called int with a value between -100 and 31. If it doesn't get it, it rolls back to the previous screen with an error message "You need to enter an integer between -100 and 31" automatically generated and the offending field marked visually.
Of course, generating the actually code for a complex layout is a huge pain which is why we have a custom parser that takes an HTML page and translates it to CGI.pm syntax. Now this type of solutions isn't for everything. (Lot's of overhead) but for a complex app it certainly can outweigh the cons.
For a simple app, this would be like lighting a cigarette with a blowtorch but unifying the input and output does offer some interesting possiblities.
My two cents anyway.
"To be civilized is to deny one's nature."