Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: HTML coded for in PERL

by wolfi (Scribe)
on May 18, 2005 at 20:03 UTC ( [id://458417]=note: print w/replies, xml ) Need Help??


in reply to HTML coded for in PERL

my usage of perl is almost entirely for web-development, so i have a lot of experience w/compatability issues etc. - but to sum up...
~yes, you should always nest tags the 'correct way' -> <TABLE><TR><TD></TD></TR></TABLE>, but unless you're using something like XML (which is particularly adamant on this point) or really jumbled up the tags - usually the browsers will still render it as expected.
~quoting strings is good, but in my experience, only necessary, when working with something other than pixels. (The percentages "100%" should be quoted.)

BUT... when it comes down to answering your question, those things are irrelevant. AFAIK, browsers will not chop up your long strings - unless they reach some arbitrary limit, that the browser sets for max. widths of pages - which could be thousands of characters. This problem is quite common w/people posting huge links and messing up your nicely designed webpages. :-P

What i do is what frodo72 touched on. I first dice large strings into arrays. (Which we don't have to do here, since you already have the data in @cut). Then, i'd do something like this...

# please note: i always miss some punctuation mark or some other overs +ight # so this may/may not work, but you get the idea... print "<TR><TD WIDTH='100%'>The annotated sequence is given below alon +g with the digested sequence<BR>"; print "<B>Annotated:</B>$anotate<BR>"; print "<B>Digested:</B>"; my $printcounter = 1; foreach $_(@cut){ print "$_"; $printcounter++; # you can put whatever number you want in here and substitute <WBR +> for <BR> # if you like (maybe use $printcounter of 4 with <WBR> or somethin +g) if ($printcounter==16){ print "<BR>"; $printcounter=1;}} print "</TD></TR>";
If you don't explicity put in the optional break <WBR> or definitive break <BR>, browsers usually will not take it upon themselves to do it for you.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://458417]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-03-19 02:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found