@JTT,
heh, thanks.
I'm headed to bed, but the short (and very simplistic) answer is that perforin is just one of the chemicals expresses by killer T cells. Others include lymphotoxin and tumor necrosis factor, depending on what it runs into. Killer T cells work in numerous way to destroy foreign invaders, but they need to be activated first. That's done by Helper T cells. Some viruses, such as HIV, attack the Helper T cells preventing the Killer T cells from being activated. Re cancer -- there are a number of different things that can go wrong resulting in cancers. T cells are only active in some of those. In fact, some cancers (lymphomas) are a proliferation of too many T-cells.
In cases where it's not a lymphoma, T cell counts are tracked to see how well the immune system is holding up to the virus/tumor. As the T cell counts go down, the infection/tumor takes over and the prognosis worsens. Also, tagged T-cells are now being used in immuno-therapies whereby a patients own T-cells are tagged with cancer-destroying markers and injected back into the patient. This helps get tumor-specific therapies directly into the tumor.
I'm not a dr, just someone who's worked with infectious diseases and diagnostic immunology research for the past 30+ years.