in reply to Re^2: Comparing strings works in Windows but not Linux
in thread Comparing strings works in Windows but not Linux
chomp will not be enough to remove whitespace at the end of the line if your text file was created on a Windows machine (or with Windows line endings) and is then used on a Unix machine (or with Unix line endings). Use a regular expression to strip all whitespace from the end of the line(s):
$negWord =~ s/\s+$//;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Comparing strings works in Windows but not Linux
by Anonymous Monk on Nov 07, 2010 at 17:52 UTC |