my @input_list = <>; chomp @input_list; for my $item ( @input_list ) { ## instead of "while (1)" ... # do what needs to be done without further directions from user }