ChocolateCake:
I should've mentioned: If you're having trouble with a loop like this, you might find it helpful to print the "interesting" variables (e.g. $offset) at the top of the loop. For example:
while (1) {
my $idxSummary = index($string, "SUMMARY", $offset);
my $result = "";
my $idxDescription = index ($string, "DESCRIPTION", $offset);
my $result2= "";
print "idxSum:$idxSummary, idxDesc:$idxDescriptioni, offs:$offset\
+n";
Then I'd imagine you'd see something like:
idxSum:47, idxDesc: 62, offs:0
idxSum:122, idxDesc: 143, offs:73
idxSum:-1, idxDesc:-1, offs:10
idxSum:-1, idxDesc:-1, offs:10
.....
Then you'd probably figure it processed the first two records, and had a problem with the third. I didn't download your code, nor the ICAL url or anything, so the numbers are entirely fictitious.
...roboticus
When your only tool is a hammer, all problems look like your thumb. |