From perldoc -f chomp:
chomp VARIABLE
chomp( LIST )
chomp This safer version of "chop" removes any trailing string that
corresponds to the current value of $/ (also known as
$INPUT_RECORD_SEPARATOR in the "English" module). It returns the
total number of characters removed from all its arguments.
The proper usage is to simply provide a variable or list that will be altered in place. The return value, which is what you use, is how many times it "chomped" its argument list. E.g.
chomp $disc;
Or even:
chomp(my $disc = `disc`);
For example, you may chomp an entire array or list, e.g.:
my @file = <$fh>; # read a whole file
my $count = chomp(@file); # counts how many lines were chomped
Of course, with a single scalar argument, the chomp return value can be only 1 or 0.