$ perl -e 'my $v = "foo\n"; $foo = chomp($foo); print "$foo\n";' 0
What would you expect this to print given that $foo is undefined when chomped? I consider this output to be entirely the correct result of that code. Why would you have it differ and in what way?
In reply to Re^2: Odd behaviour of chomp()
by hippo
in thread Odd behaviour of chomp()
by Salvor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |