my @file_line_contents = ...; my @line_lengths = map length($_), @file_line_contents;