Hey Monks,
I'm taking a file that was written in notepad, importing it to my linux machine, and trying to chomp the lines and display them in a tree view. As I quickly found out, chomp won't work with it's default value because windows format uses crlf and not \n. Quick question, is it best to just change the value of $/ ? And if so, is this the way i would do it?
local $/ = "\r\n"; open(FILE, "environments.txt); my @temp = <FILE>; foreach my $line (@temp){ chomp($line); print $line; }
print used instead of treeview just for illustration
In reply to crlf to \n by rgb96
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |