I am trying to create a web page using iPhoto's built in "Web Page" output (from the Share menu). It works fine like that, but when I run it through my Perl script to put in some necessary CSS and HTML, it drops certain important things, like headers and, sometimes, the entire page! I thought that someone here might have a clue as to what is happening here. Anyways, here is the suspect code: Code: #!usr/bin/perl $chopped = 0; while(<>) { if($chopped == 1) { print; next; } if(/<body/) { $chopped = 1; } } This code reads from whatever - in this case, another program - and then prints all the text after the string "<body", which, hopefully, all of the iPhoto pages will have. After this is done, I put my header into this, along with the "<body>" statement to make it whole again. Sometimes, it doesn't find the string "<body", I think. That would explain why the page doesn't have any content. But why would iPhoto randomly drop a HTML tag? Help is appreciated
Problem fixed. The issue was stemming from another file in the series, and I was reading and writing from the same thing at the same time... :/