Tests which assess the ability to shift cognitive set modelled after the Wisconsin Card Sorting Test are particularly sensitive to impairments in patients with Parkinson's disease as well as in patients with frontal lobe damage. However, the underlying mechanisms responsible for the similar deficits observed in the two patient groups are not well understood and may not be identical. For example, an apparent deficit in set-shifting ability may reflect either an impairment in the ability to shift from a perceptual dimension which has previously commanded attention (i.e. 'perseveration'), or in the ability to shift to an alternative perceptual dimension which has previously been irrelevant (i.e. 'learned irrelevance'). In this study, the performance of both medicated and non-medicated patients with Parkinson's disease were compared with a group of neurosurgical patients with localized excisions of the frontal lobes on a novel task designed to assess the relative contribution of 'perseveration' and 'learned irrelevance' to impaired set-shifting ability. Patients with frontal lobe damage were worse than controls in their ability to shift attention from a previously relevant stimulus dimension. Medicated patients with Parkinson's disease were worse at shifting to a previously irrelevant dimension. In contrast to both groups, nonmedicated patients with Parkinson's disease were impaired in both conditions. These results suggest that the gross set-shifting deficits reported in both frontal lobe patients and patients with Parkinson's disease may involve fundamentally different, though related, cognitive processes, and that these may be differentially affected by medication. Specifically, L-dopa therapy may protect Parkinson's disease patients from preservation of attention to a formerly relevant stimulus dimension.