in reply to How do you chomp your chomps?

Personally, I have never used the return value from chomp, but that's not to say it's useless. Did you know you can chomp an array?
my @array = ( "one\n", "two\n", "three", "four\n" ); my $result = chomp @array; print $result, $/; print @array;
In that snippet, $result is set to 3 and all elements of the array have had their trailing newline removed. Offhand, I don't see the utility of chomp returning the number of elements chomped, but I also remember that when I first started programming, I didn't see the utility of the ternary operator ( y = x ? y : x ). Now, I use it all the time.

chomp itself is very useful when I pull in data from a variety of sources and do something with them. I usually don't want a bunch of newlines unless I put them there.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.