Don't over estimate the smallness of the footprint of a shell.
Some quick testing shows that (at least on my system), perl
takes less than twice the memory of bash. And it takes less
memory than bash + grep combined. One should realize that a
shell might take less memory than perl, but do to something
interesting in a shell, you got to use additional programs.