in reply to Re: Howto convert lines in stringified text into element of an array
in thread Howto convert lines in stringified text into element of an array
my $file; my @data_lines; while (<DATA>) { $file .= $_; chomp; push @data_lines, $_; } my @split_lines = split $/, $file; print(scalar(@data_lines), "\n"); # 3 print(scalar(@split_lines), "\n"); # 2 __DATA__ foo bar
|
|---|