Hullo,
I have the following script with bits snipped out:
my(@cvscommits) = ("Lala", "po", "tinkywinky");
my($cvs) = join("<br>", @cvscommits);
my($updatetime) = "11";
my($line) = "<tr><td><a href=\"\\\\$COMPUTERNAME\\$softdev\\$dirtime\"
+<b>$COMPUTERNAME</b></a></td><td>$processors</td><td>$dirtime</td><td
+>$cust</td><td>$target</td><td>$cotime</td><td>$updatetime</td><td>$b
+uildtime</td><td>$result</td><td>$cvs</td></tr>\n";
for (@testarray) {
#find the line below
if (/<tr><th>PC Number<\/th><th>Cores<\/th><th>Date<\/th><th>C
+ustomer<\/th><th>Target<\/th><th>C\/O Time<\/th><th>Update time<\/th>
+<th>Build Time<\/th><th>Status<\/th><th>Changes from Last Build<\/th>
+<\/tr>/) {
print "Whee found it \n";
#then add the following line *after it*
$_ .= $line;
last;}}
untie @testarray; #finish the array :)
It's supposed to open up an html file and insert the $line after the point referenced above. Instead of inserting $line after it (as it should) it writes $line at the bottom of the file *after* everything else. I tried with a simple text file, and it inserted my ersatz text line with ease, but as soon as I insert html, it starts adding it to the end of the file.
I know it finds the line because of the "Whee found it" message.
Whenever I open up the html file in an editor, it asks if I want to convert the html file to a dos file. (I also end up with some funky ^M characters under Vim.)
So the questions are:
1.Is there something fundamentally different between html and txt files that I should know about here?
2. Have I made another noob mistake somewhere I can't see?
3. Is it likely that my join command is throwing in problems?
Thanks for your time :E
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.