while (my $line = <>) { @chunks = split(/","/, $line); # other stuff }