From 36e9be2699d1fc8713660f4e45cbb380c64fdd72 Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Wed, 14 Feb 2024 15:55:36 +0800 Subject: [PATCH] colrm: accidental $_ * In 2-argument colrm, default variable $_ is not used in the loop * Adding \n back to line is reversing the chomp at start of loop * I checked that $_ did not have a value here * test: "perl colrm 2 2 < file.txt" removes the 2nd character on each line of file.txt --- bin/colrm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/colrm b/bin/colrm index 02891be7..cc668607 100755 --- a/bin/colrm +++ b/bin/colrm @@ -54,7 +54,7 @@ if (@ARGV > 2) { print substr $line, 0, $startcol - 1; print substr $line, $endcol; } - print "$_\n"; + print "\n"; } } exit EX_SUCCESS;