in reply to Using a variable to define a variable
A "more Perlish" way to do this is something like (untested):
See map.my @file_line_contents = ...; my @line_lengths = map length($_), @file_line_contents;
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):
See Slices in perldata.my @file_line_contents = ...; my @line_lengths = map length($_), @file_line_contents[ 0 .. 44 ];
Give a man a fish: <%-(-(-(-<
|
|---|