in reply to Reading notes in gedcom files?

Although I don't know what Gedcom is or what's used for

I think your inner loop should have print $n instead of print $i->note