Brent wrote:

> Sigh... just spent six frustrating hours trying to figure out why
> a complex
> Javscript/Perl/MIDI thingy I'm working on kept giving me errors
> in NS 3.0,
> while working fine in NS 4, MSIE 3 and MSIE 4... went through miles of
> code with the proverbial fine-toothed comb, tweaking, uploading,
> tweaking, uploading... no joy.
>
> Finally started fiddling with bits of HTML that by rights should
> have had no
> impact whatever on the JS or Perl stuff... and for the hell of it changed
> the width of a table from relative (90%) to fixed (540) -- bingo.
>  Worked.
> Tried various other combinations of table and cell widths, it crapped out
> again... set it back to 540, worked.
>
> I should stress that there's zip in the code that sets or calls
> table widths
> in any way... it has nothing (well, nothing sensible) to do with the
> document structure or display.  But nonetheless.

You mentioned that the code involved Perl:

"Javscript/Perl/MIDI thingy"

In Perl, the % sign denotes a "hash" type of array. In the HTML generated by
your Perl script the perl interpreter will read the % as a hash designator,
not just as a percent sign, unless you escape it with a backslash. Try doing
this:

<table width="90\%">

and see what happens. Other Perl "designators" (I'm not sure what the
"proper" term is) to watch for are @ and $. For example:

        brent\@almonte.com

or

        Total cost \$5.00

You have to escape the @ symbol, otherwise Perl thinks you're trying to
refer to the @almonte array. The $ sign indicates a scalar (proper geek
term) variable, so you have to escape it when you want your HTML to just
show a $ sign.

To help you debug your scripts, place -w at the end of the first line of
your perl script, for example:

#!/usr/local/bin/perl -w

When you do this, Perl will write a verbose description of what went wrong
to the error log on your server. You won't just be looking at those 500
error messages: you'll be able to look at the tail of the error log to see
where the script went wrong.

Also note that you will have to escape %,@ and $ in your javascript when it
is PRINTed to the browser (unless you want Perl to recognize the %,@ and $
variable designators).

Jack

____________________________________________________________________
--------------------------------------------------------------------
 Join The Web Consultants Association :  Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------

Reply via email to