Cgi.pm and CSS

T

Tad McClellan

Nikos said:
here what i manage to do but still it has some erros i think which i
cant see:


If you can't see them, how do you know that they are there?

You must have observed *something* that makes you think it has errors.

What did you observe that makes you think it has errors?

You should provide one or more symptoms if you hope for a diagnosis.


Please stop posting incoherent questions.

Please stop posting long programs.

I encourage you to stop your general abuse of our newsgroup.
 
N

Nikos

Tad said:
PLEASE QUOTE SOME CONTEXT WHEN COMPOSING FOLLOWUPS!

Please do this very soon if you want the maximum readership
for your posts in the future.

Sorry for that Tad, i always quote messages but i was just too confused
at the moment.

For example in my cgi.pm vesrsion i was loading the value in a drop down
menu. here i try to dot he same in my tamplate file but i cant. i cant
evne print a value

<TMPL_LOOP name=@files>
<option value="<TMPL_VAR name=@files>"><TMPL_VAR name=@files></option>
</TMPL_LOOP>

here is the perl code that tries to fill in those values:

@display_files = map ( /([^\/]+)\.txt/, glob '../data/text/*.txt' );
@files = map { option => $_ }, @display_files;
$tmpl->param( options => \@files );

Why doesnt it fill the values in the drop down menu?
 
J

J. Gleixner

Nikos said:
<TMPL_LOOP name=@files>
<option value="<TMPL_VAR name=@files>"><TMPL_VAR name=@files></option>
</TMPL_LOOP>

here is the perl code that tries to fill in those values:

@display_files = map ( /([^\/]+)\.txt/, glob '../data/text/*.txt' );
@files = map { option => $_ }, @display_files;
$tmpl->param( options => \@files );

Why doesnt it fill the values in the drop down menu?

Please read the documentation for HTML::Template on how to use
TMPL_LOOP. You'd want something like:

<TMPL_LOOP name="FILES">
<option value="<TMPL_VAR name="FILENAME">"><TMPL_VAR
name="FILENAME"></option>
</TMPL_LOOP>

And,

my @files = map { FILENAME => $_ }, @display_files;
$tmpl->param( FILES => \@files );

It's all well documented and there are a lot of examples of using
HTML::Template floating around the Internet.
 
N

Nikos

Tad McClellan wrote:

My apologies.
I have decided not to continue the effort of trying to understand
html::template so i will stop making such questions.
 
F

Fabian Pilkowski

* Nikos said:
Nikos wrote:

Guys i accidentaly lost the original index.pl i posted with the greek
chats and i have no backup.

please can someone post it back correctly?
I eman i can see it now on usenet form my post but the chars are not
greek, they are showing very weird and if i copy paste then i have a lot
more errors come up cause of the chars.

Damn i am complete messed up.
Please someone post my inde.xpl back correctly

Sorry. You never posted your index.pl with Greek characters inside.
However, the result which your index.pl produces still exists. Please
use <http://groups.google.com> to search for previous postings.

http://groups.google.com/[email protected]

You can see that your index.pl contains all those weird letter already.
But, have a look at your webserver. I requested your page again and it
seems the script is working there, even now.

regards,
fabian
 
F

Fabian Pilkowski

* Nikos said:
Tad McClellan wrote:

My apologies.
I have decided not to continue the effort of trying to understand
html::template so i will stop making such questions.

Ok, it's your decision. I have posted a complete and working template
for you. After your changes it has refused to work. Why not testing the
template I've posted for you?

Moreover, one has mentioned that Dreamweaver can generate templates for
Perl's HTML::Template, but you decided to carp about weird HTML tags, do
you? Why not using Dreamweaver as you like (and know) that program?

It is difficult to help you since you aren't willing to learn as much as
you need to solve your problem. I suggest to continue using CGI.pm and
its HTML-generating stuff. And when you want to try separating HTML and
Perl code again, reflect on this thread ;-)

regards,
fabian
 
N

Nikos

Fabian said:
Ok, it's your decision. I have posted a complete and working template
for you. After your changes it has refused to work. Why not testing the
template I've posted for you?

I did test it and try to work with it and make the appropriate changes
but unfortunately it didn work out. i couldne wven print a single
variables value when the html page run.
Moreover, one has mentioned that Dreamweaver can generate templates for
Perl's HTML::Template, but you decided to carp about weird HTML tags, do
you? Why not using Dreamweaver as you like (and know) that program?

I did downlaod Dreamweaver but i saw it didnt work with Perl but just
with PHP and other languages and i uninstalled it.
It is difficult to help you since you aren't willing to learn as much as
you need to solve your problem. I suggest to continue using CGI.pm and
its HTML-generating stuff. And when you want to try separating HTML and
Perl code again, reflect on this thread ;-)

Thank you for all the support Fabian and your willing ness to help. I
agree with you that i tend to learn only those thing i need thats why i
am fruistrating oftenly and i also noticed i cant read too much the
docs. I dont know why. i just need workign examples to undestand and
more adequate explantaion the one that you provided so once again thanks
for your willingness to help me out but i just i dont know why i dint
like the html::template stuff. I will continue using cgi.pm and its not
that bad really now with the help of css ;-)

If only i could seperate the javascript part of my webpaghe and put it
in a single file would be good.
 
N

Nikos

Fabian said:
You can see that your index.pl contains all those weird letter already.
But, have a look at your webserver. I requested your page again and it
seems the script is working there, even now.

Well yes i have putted back the code i posted on usenet and i didnt have
any other solution but to rewrite all the Greek stuff from scratch ;-)

i'll try to psot something in Grteek now that i have set the encoding in
UTD 8 to see if it will be posted ok. lets see:

"ΚαλησπέÏα παιδιά"
 
N

Nikos

Nikos said:
Well yes i have putted back the code i posted on usenet and i didnt have
any other solution but to rewrite all the Greek stuff from scratch ;-)

i'll try to psot something in Grteek now that i have set the encoding in
UTD 8 to see if it will be posted ok. lets see:

"ΚαλησπέÏα παιδιά"

Gee! Now is ok! If i only have made the precious source code for
index.pl in UTF-8 i would have saved my ass off rewriting it but iam
used of funny things happening to me :)

ps. sorry for the language ;-)
 
F

Fabian Pilkowski

* Nikos said:
I did test it and try to work with it and make the appropriate changes
but unfortunately it didn work out.

There are no necessary changes to do. Just using it ;-)
I did downlaod Dreamweaver but i saw it didnt work with Perl but just
with PHP and other languages and i uninstalled it.

Oh, I thought you are familiar with Dreamweaver. That's because you have
mentioned this program in one of your first postings here (and you meant
you could do more fancy stuff with it). But be aware, writing HTML pages
without basic knowledge about HTML is not recommendable -- neither with
CGI.pm, IMHO ;-)
If only i could seperate the javascript part of my webpaghe and put it
in a single file would be good.

As I already suggested, try to branch out that part of your javascript
where all the *content* of your page is defined (I've given an idea how
to do this). Then, you are able to create a new file for the *static*
part of your javascript code. *Including* a separated file as javascript
code to your HTML page is not as difficult as it could be ;-)

regards,
fabian
 
N

Nikos

Fabian said:
There are no necessary changes to do. Just using it ;-)

I did cut/paste and tried to use the script as it ws but it aint running.
Neither the html appeared correctly and also it was printing any value
that index.pl gave it by print $tmpl->output;

I try to make changes too but didnt work either.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top