Hi shroh. In addition to the above suggestions, see the response to your other question referencing Path::Tiny::lines and its chomp => 1 attribute. This will remove the newline character from the lines as they are pushed onto the array of lines. Then you can just do next if $line =~ /^$/;
In reply to Re: Way to remove the new line characters at the end of the content in a file
by 1nickt
in thread Way to remove the new line characters at the end of the content in a file
by shroh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |