Re: Web Interface and index.pl separated?!?
- From: axel@xxxxxxxxxxxxxxxxxxxxxx
- Date: Tue, 12 Apr 2005 22:17:58 -0500
Nikos <hackeras@xxxxxxxxx> wrote:
> Inside my webpage index.pl i ahve the Perl code and the interface of the
> page: Do you think that i must separate the page's interface in a file
> by itself and then in another index.pl make calculations and stuff with it:
It is probably easiest to work with the both in the same file.
> i have i as follows to generate graphics. here is a asmall part:
> print start_form(-action=>"show.pl");
> print table( {-border=>1, -width=>"60%", -align=>"center",
> -style=>"border: ridge magenta; color: lime; font-family: Times;
> font-size: 18", -background=>"../data/images/swirl.jpg"},
> Tr( {-align=>'center'}, td( "??? ?? ???? ???????" ),
> td( textfield( 'onoma' ))),
> Tr( {-align=>'center'}, td( "???? ????? ? ????? ??? ??? ??? ???????
> \"????? ????? ?????? ??????? ??\"?"
> ), td( textarea( -name=>'sxolio', -rows=>5, -columns=>30 ))),
> Tr( {-align=>'center'}, td( "???????? ???? ??? ??? ???? ?? ????? ???
> ???????? ????????? ??? ??????????
> ????????
> ??? ??????? ??????? ???? ?????? ???
> ????????? ??????? (?? ?????? ?????
> :-)" ), td( textarea( -name=>'symvan', -rows=>7, -columns=>30 ))),
> Tr( {-align=>'center'}, td( "???? ????? ?? e-mail ????" ),
> td( textfield( 'email' ))),
> Tr( {-align=>'center'}, td( submit( '???????? ???? ??? ???????'
> )), td( submit( '????????' ))));
> print end_form(), br(), br();
>
> also inside index.pl a have javascript embedded in a here document.
>
> Is this wrong approach?
No... it is whatever you find most convenient.
> For example how could i rewrite the above script?
> The funny stuff is actually Greek! :-)
One way would be to do the calculations required and then print all the
HTML with any results inserted as a 'here' document (or several to keep
the relevant calculations close to the output templates).
But then I have never really seen much point in adding an extra layer of
complexity by using functions in creating HTML.
Axel
.
- Follow-Ups:
- Re: Web Interface and index.pl separated?!?
- From: Lord0
- Re: Web Interface and index.pl separated?!?
- References:
- Web Interface and index.pl separated?!?
- From: Nikos
- Web Interface and index.pl separated?!?
- Prev by Date: Re: Web Interface and index.pl separated?!?
- Next by Date: Re: Is Perl open source?
- Previous by thread: Re: Web Interface and index.pl separated?!?
- Next by thread: Re: Web Interface and index.pl separated?!?
- Index(es):
Relevant Pages
|