So, the chomp function isn't working as I expect. I'm reading a string into an array and using the split function to split the input on the \n, which is working fine. However, once I have the array, I want to get rid of the \n. My line chomp(@array) isn't chomping the \n.
Here are the lines from my code. The arrays are exactly the same when printed out. What am I missing?
my @arr1 = split/\n/,$var; print "@arr1\n"; chomp(@arr1); print "@arr1\n";
In reply to "chomp" not working by cuautemoc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |