Perl would be overkill here.
find . -maxdepth 1 -mindepth 1 | wc -l
(better use `grep -c /` instead of `wc -l` in case some filenames have newline characters in them).
Or with GNU `ls`:
ls -A | wc -l
With `zsh`:
f=(*(D))
echo $#f
To remove one:
... | tail -n +2 | wc -l
Or:
n=$(... | wc -l); echo "$(($n - 1))"
With perl, you can use the `-n` or `-p` flag:
... | perl -lpe '--$_'
Above that `--$_` expression is evaluated and the content of the `$_` variable printed for each line of input.