Created
November 2, 2016 19:01
-
-
Save alexagranov/464bd8212b3c04a0da73f3f064d580a6 to your computer and use it in GitHub Desktop.
Count number of tabs per line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use v5.18; | |
my $MAX_TABS = 22; | |
while (<STDIN>) { | |
chomp $_; | |
my $c = ($_ =~ tr/\t//); | |
if ($c > $MAX_TABS) { | |
say "There are $c on line $."; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment