This study aimed to examine the effects of cognitive tasks during walking with perturbation on the cerebral blood flow. The subjects were a total of 20 persons, consisting of 12 healthy adults aged 21-47 years (adult group) and 8 retirement home residents aged 67-85 years who led an independent daily life and could walk independently (elderly group). Oxyhemoglobin was measured using wireless functional near-infrared spectroscopy (fNIRS). An analysis was conducted using the Wilcoxon rank sum test to compare the variation of oxyhemoglobin between walking with perturbation (WP) and walking with perturbation and cognitive tasks (WPC) in each group. In addition, we compared the variation of oxyhemoglobin between groups by analysis of covariance adjusting for the value of WP. In the adult group, the left and right oxyhemoglobin significantly increased under WPC (p=0.0122, 0.0015, respectively). On the other hand, in the elderly group, the right and left oxyhemoglobin did not significantly change under WPC. These results suggest that the effect of a cognitive task during unstable walking conditions differs between healthy adults and elderly persons, and that this may be important when considering postural control strategies, especially in the elderly.