... my @row = split (/,/,$_); # I believe this is what you trying to do chomp( my $var = $row[1]); # Or maybe a little bit more understandable $var = $row[1]; chomp $var; # Return the total number of characters removed in $row[1] to $chomp_result # (in your case every 1 stands for a character chomp found in $row[1] could # be a line break or something like that ) my $chomp_result = chomp( $row[1]); print "$var || $chomp_result\n"; ...