5 ms·
Thank you for this. I hate trying to read Perl so much. What is the "#/+" for?
by metalliqaz 5y ago
Thank you for this. I hate trying to read Perl so much.
What is the "#/+" for?
- jwilk 5y agoOn Fridays, it's just a comment. Otherwise, "f/1;#/+" is equivalent to something like: f(/1;#/ +) where /1;#/ is a regexp matching operator, and stray + triggers syntax error.
- space_ghost 5y agoFlavor? "#" starts a comment, so the "/+" characters are ignored by the interpreter.
- deleted 5y ago[deleted]
- G3rn0ti 5y ago> What is the "#/+" for? I am sure this is not necessary for the behavior described. It's just a comment. BTW: I am working for a company still maintaining a large Perl code base and I think this is rather obscure stuff. You rarely need to run something at compile time, hack the symbol table and you almost never need "sub() {}" to define subroutines with an empty "prototype". If I saw this in a code review I would most definitely had a closer look and would decline a PR if that was unnecessary. Meta programming should not be done lightheartedly and better serves a serious purpose.
- mmaunder 5y agoWorked as a Perl dev for 15 years and enjoyed it. The hardest thing was the number of ways to do OO Perl using Perl5. Everyone has their own flavor. And TMTOWTDI was a motto the community was proud of. Having said that, nothing could touch mod_perl performance under Apache in the late 90s. Massive web apps were built on this including eToys dot com where I worked before it imploded in the dot-com bust.
- cutler 5y agoMoose, Mouse, Moo, Mo ... bah! Just give me The Damian's simple blessed hashref.
- tomc1985 5y ago> Worked as a Perl dev for 15 years and enjoyed it. The hardest thing was the number of ways to do OO Perl using Perl5. Everyone has their own flavor. And TMTOWTDI was a motto the community was proud of. One of my frist dev jobs was slinging perl script, I loved that attitude and it made for a fantastic learning environment. I really dislike the feeling of having to write code in a straightjacket because tHe TeAm CaN't UnDeRsTaNd iT!!! We minimized the negatives of TMTOWTDI by incorporating a house style, but it was flexible because we were all smart people whose minds didn't crash because we saw a statement we didn't expect.
- programd 5y ago> Worked as a Perl dev for 15 years and enjoyed it Similar situation here. Perl is awsome and I'm still bitter that Python won. I mean significant whitespace - what great madness is this??? Anyway, yes, mod_perl ran the Web for about a decade in the early 2000s and I built and maintained huge websites which were all Perl on the back end. BTW the book "Perl Best Practices" by Damian Conway [0] is the best general programming book I have ever read. Every software engineer should read it no matter what language they program in. So much good advice which applies to pretty much any significant software project. IMHO right up there with the "Mythical Man Month", though obviously much more low level. [0] https://www.oreilly.com/library/view/perl-best-practices/0596001738/ https://www.oreilly.com/library/view/perl-best-practices/059...
- cutler 5y agoThe Damian was a phenomenon of pure inspiration. In fact Perl community in general had a pantheon of acolytes I've never seen in any other programming community. Ruby has a few but nowhere near as many as Perl. Perl in the early 2000s really was on fire.
- hnick 5y agoPerl makes you think differently. True for all languages I guess, but maybe a little truer for Perl than most. I've moved on but still use it for simple scripting tasks despite doing my best to learn Python. I just feel so expressive and unconstrained writing it, for better or worse.