in reply to running programs

i would use
while (<>) { chomp $_; #defined by a list if directories piped in chdir $_; system " run prog"; chidr .. }
but the inputs do vary!?