Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: losing html in print calling function.

by Librum (Initiate)
on Nov 21, 2011 at 16:10 UTC ( [id://939240]=note: print w/replies, xml ) Need Help??


in reply to Re: losing html in print calling function.
in thread losing html in print calling function.

Remiah,

I knew that was clumsy, let me try again.

this is one of the calling print lines.

if (open(THE_FILE, $prestring . "WWM.txt")){print "<center><img border +=0 src=/article_separator.png><br><B>WWM: Windmills and Wind Motors. +1910.</B></center><br>";fn1();} else {print "<center><img border=0 sr +c=/article_separator.png><br><b>Windmills and Wind Motors, 1910,</b> +has no ATOCI.</b></center><br>"};

In the output, it does not render the center, the img, the line break, the bold. It does render the "WWM: Windmills and Wind Motors. 1910". Then no render of the nobold, the nocenter, the line break. It does render from the function print line html tags.

Back to testing... And thanks for responding.

Replies are listed 'Best First'.
Re^3: losing html in print calling function.
by LesleyB (Friar) on Nov 21, 2011 at 16:24 UTC

    It does seem a strange bug. Have you checked the value of $prestring? I would not suspect fn1 in this case.

Re^3: losing html in print calling function.
by LesleyB (Friar) on Nov 21, 2011 at 16:48 UTC

    I took another look at your page and checked the source again.

    Where a list of results occurs, e.g search for apple and look at the data found in "FCOA: Farmers Cyclopedia of Agriculture. 1911"; there is malformed HTML

    <center><img border=0 src=/article_separator.png><br><B>FCOA: Farmers +Cyclopedia of Agriculture. 1911.</b></center><br><center><TR><td>APPL +E&#65533;Root-grafting, root vs. top-grafting, location and soil, pla +nting the trees, cultivation and cover crops, manuring, pruning, harv +esting and storage, utilization of waste apples, varieties, general s +cheme for spraying apple trees, enemies</td><td> 216</td></tr> <br><center><TR><td>PINEAPPLE&#65533;Locations, propagation, fertilize +rs, growing under sheds, varieties, enemies</td><td> 287</td></tr> <br><center>Apples, 216<Br> <br><center>Apples, Aphis, 228<Br> <br><center>Apples, Bitter Rot, 223<Br> <br><center>Apples, Borers, 226, 270<Br> <br><center>Apples, Brown Rot, 224, 275<Br> <br><center>Apples, Bud Moth, 227<Br>Rot, 223<Br>

    with some table markup being thrown in and no closing center tag on the record data returned from the file.

    Your initial file title is there

    <center><img border=0 src=/article_separator.png><br><B>FCOA: Farmers +Cyclopedia of Agriculture. 1911.</b></center><br>

    but I would assume the sudden appearance of table markup followed by unterminated center tags isn't helping your output. In this case I would say the error is probably in your original fn1 function where you print the record out and the table markup is in the data you pick up. Neither of these is a Perl problem although they can be solved with Perl

    If I haven't identified your problem, would you please post a snippet of HTML that shows the problem?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-26 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found