deprecated has asked for the wisdom of the Perl Monks concerning the following question:
So I actually have written highly portable code that works on any of our servers, through any of the clients looking at it, and does what I need it to do.
The problem is I have written code that does not have a pretty interface, and no provisions therein.
Here's an overview of how stuff is currently done:
======== ============== = = perl = javascript = = HTML = <------- cgi <-------============== = = = html = ======== ============== ^ | | ============== = oracle = ==============
When the url is requested, the perl program answers. The output in html is essentially a composite of three things. First, you have the oracle data. So, say we have "name" and "address". You also have an HTML template so that the web design people can just create a page look-and-feel. However, if you want to be able to provide names and addresses for people in hawaii, alaska, new york, it might be nice to be able to have palm trees, sky scrapers (or rude people, ymmv), and snow as a theme, depending upon which user you are sending data to. The javascript allows us to create interface-specific stuff that might be difficult to do in perl/html (that was not my call, and isnt up for discussion).
The challenge thus, is to be able to have perl programs that run independantly of the database, and still provide them with a uniform style. Javascript is not necessary. Images and tables may well be. You have perl content that needs to be displayed in a fashion that is configurable to some extent by the users (after all, it is their interface), and also configurable by the site/application owner.
Take this for example:
Do we then extrapolate from the above that we can do:sub enter_data { print start_form, textarea( -name => 'name', -default => 'Smith, John' ), end_form; return 1; }
But what about more complicated schemes, like having a top logo bar and a left navigation bar, and a footer, and having your form in the middle? Because HTML is highly linear, i.e., it renders top-to-bottom, left-to-right, its not possible to paint the page and then add a form smack in the middle (well, at least not without frames, and nuh-uh, no frames on this 'ere site).sub be_pretty { print img( -src => '/img/purdy.png' ), br(), img( -src => '/img/splashlogo.png' ); } be_pretty(); enter_data();
So, what, then, is the best way to allow for stylistic changes and a "graphical" side of your average perl cgi? Or, perhaps that is an open-ended question I should tie down a little. What ways have you used and which ones were successful? Not successful? Any other insights?
brother dep.
--
Laziness, Impatience, Hubris, and Generosity.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating Stylized Perl Applications With Uniformity (code)
by Masem (Monsignor) on May 30, 2001 at 18:40 UTC | |
|
Re: Creating Stylized Perl Applications With Uniformity (code)
by merlyn (Sage) on May 30, 2001 at 18:36 UTC | |
|
Re: Creating Stylized Perl Applications With Uniformity (code)
by cacharbe (Curate) on May 30, 2001 at 19:38 UTC | |
by jeffa (Bishop) on May 31, 2001 at 02:14 UTC | |
|
Re: Creating Stylized Perl Applications With Uniformity (code)
by DBX (Pilgrim) on May 30, 2001 at 22:40 UTC | |
|
Re: Creating Stylized Perl Applications With Uniformity (code)
by larryk (Friar) on May 31, 2001 at 00:27 UTC | |
|
Re: Creating Stylized Perl Applications With Uniformity (code)
by novitiate (Scribe) on May 31, 2001 at 01:20 UTC | |
by mattr (Curate) on May 31, 2001 at 10:08 UTC |