It's not really linecount-based, for me - I'll do it as soon as the need for calculation or complex processing becomes significant, or if it's apparent from the beginning. Contrariwise, if the task mostly requires filesystem operations rather than either of the above, I'll stick with a shell script. I've even been known to do a back-ticked Perl op in a shell script that's doing heavy filesystem lifting - and have also done Perl scripts with the occasional back-ticked shell op. Having both gives me a lot of flexibility/granularity along that spectrum.
--
Human history becomes more and more a race between education and catastrophe. -- HG Wells