in reply to how to split based on new line or others ?
my $file_name = ...; open(my $fh, '<', $file_name) or die("Unable to open file \"$file_name\": $!\n"); while (<$fh>) { # $_ contains a line, including the "\n". # Use "chomp;" to remove the trailing "\n". ... }
By the way, please use <c>...</c> instead of <pre>...</pre> on PerlMonks.
|
|---|