Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This always seemed like the sweet spot for Perl.


500 lines of bash could have been rewritten as 50 lines of dense Perl. Pro: fewer lines of code. Con: even the author would find the Perl script inscrutable after a few weeks.


A more experienced Perl hacker would probably rewrite it as 100 lines of less dense code that people could actually read and comprehend.

I'd probably end up rewriting it as 50 lines of code that used a bunch of pure perl libraries and then use https://p3rl.org/App::FatPacker to bolt the dependencies onto the front for distribution so it was still a single file to install for everybody else.

(there's a lot of perl out there that uses techniques I would switch away from as soon as I got past a one liner in the middle of a pipeline, alas, but it doesn't have to be that way, perl just doesn't stop you blowing both feet off ;)


It is. Very much so.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: