in reply to Using a variable to define a variable

A "more Perlish" way to do this is something like (untested):

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

Update: Or if  @file_line_contents is likely to be more than 45 elements and you want the length array to be limited to 45 (untested):

my @file_line_contents = ...; my @line_lengths = map length($_), @file_line_contents[ 0 .. 44 ];
See Slices in perldata.


Give a man a fish:  <%-(-(-(-<