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

It was indeed, and I spent much time wailing and gnashing my teeth as a Perl programmer that nothing similar existed in Perl.


> It was indeed, and I spent much time wailing and gnashing my teeth as a Perl programmer that nothing similar existed in Perl.

mod_perl2[0] provides the ability to incorporate Perl logic within Apache httpd, if not other web servers. I believe this is functionally equivalent to the cited PHP Apache module documentation:

  Running PHP/FI as an Apache module is the most efficient 
  way of using the package. Running it as a module means that 
  the PHP/FI functionality is combined with the Apache 
  server's functionality in a single program.
0 - https://perl.apache.org/docs/2.0/index.html


The key difference was that you had to adapt your Perl to work with mod_perl, where mod_php "just worked" in the same way CGIs did -- you could throw your .php scripts up over FTP and they'd benefit from mod_php being installed. This was a massive difference in practice.

EDIT: I have managed to dig out slides from a talk I gave about this a million years ago with a good section that walks through history of how all this worked, CGIs, mod_perl, PSGI etc, for anyone who wants a brief history lesson: https://www.slideshare.net/slideshow/psgi-and-plack-from-fir...


Just a story of my past.

I got into web dev in the tail end of perl and cgi-bin. I remember my first couple scripts which were just copy/paste from tutorials and what not, everyone knows how it goes. It was very magical to me how this "cgi-bin" worked. There was a "script kiddy hacking tool" I think named subseven (or similar) written partially in perl that you would trick your friends into running or you'd upload on filesharing. The perl part gave you your web based C&C to mess with people or open chats or whatever. I really got into programming trying to figure out how this all worked. I soon switched over to PHP and in my inexperience never realized the deployment model was so similar.

I do think this model of running the script once per request and then exiting really messed with my internal mental model of how programs and scripts worked. Once I was exposed to long running programs that could maintain state, their own internal data structures, handling individual requests in a loop, etc, was a real shock and took me awhile to conceptualize.


I had the same experience! I started out with Perl and CGI, then moved to PHP. Switching to a world where the web application kept running across multiple requests took me quite a bit of effort to get used to.


It is so odd how request-centric my worldview was back then. I literally couldn’t fathom how “old legacy crusty languages” like c/c++ could possibly be behind a website. Learning google was built this way blew my mind.

It’s strange thinking back to the days where persisting information as simple as a view counter required persisting data to a flatfile* or something involving a database.

These days with node and our modern languages like go and rust it’s immediately obvious how it’s done.

I think it’s both a mix of me learning and growing and the industry evolving and growing, which I think all of us experience over time.

* for years using flat files was viewed as bad practice or amateurish. fun to learn years later that is how many databases work.


> It’s strange thinking back to the days where persisting information as simple as a view counter required persisting data to a flatfile* or something involving a database

> These days with node and our modern languages like go and rust it’s immediately obvious how it’s done.

Okay I'll bite. How is it done now and why is the new way better than using a DB?


Persisting information should be done using a database, though. Otherwise your view counter will reset to zero on server restart. Overall I still think PHP's request-centric model is the best fit for the web.


sub7 was a windows binary (client and server), but it’s possible there was an unofficial perl interface for it or something similar. the perl era definitely saw a lot of precursors to modern C2 dashboards


I might be mixing it up with a similar tool around the same time period, although thanks for confirming there did exist a thing called sub7.

I do remember being exposed to the arcane Perl syntax for the first time so it must have been a different program.


Indeed. Perl was better in many ways, but not in the one that mattered to its continued viability.




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

Search: