Flubb has asked for the wisdom of the Perl Monks concerning the following question:
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.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 :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tie::file and html vs dos
by Tanktalus (Canon) on Feb 07, 2008 at 17:54 UTC | |
|
Re: Tie::file and html vs dos
by citromatik (Curate) on Feb 08, 2008 at 09:12 UTC | |
by Flubb (Acolyte) on Feb 08, 2008 at 15:42 UTC |