And I'm not a new, disgruntled user. I like the site a lot and am quite active on the IT Security stackexchange site. From my semi-moderator's point of view, the only place for discussion is the chat function (which only a few regulars use).
I'm not quite sure what is going to fill this gap. I don't always have a place to post things. Blogging doesn't exactly work without an audience. The mainstream things these days appear to be just chats. There are still forums, mailing lists... heck, there are BBSes but it's niche and hard to find anything that isn't already on the decline.
It was a nice forum and I really wanted it to succeed and but it seems to have faded out.
Reddit?
Where are y'all based? I'm reasonably happy with my current job, but I'm definitely curious about what else is out there (especially if it's not in the Bay Area).
https://careers-interactivebrokers.icims.com/jobs/1777/progr...
* Perl is set up for really terse one-liners. You can basically emulate or surpass most Unix tools with only a cursory knowledge of the syntax
* Perl syntax is highly geared towards text processing and regular expressions. File handling and regexes are so much quicker and easier to use than Python.
If I were in a situation where I had a bunch of files I needed to process and the task didn't easily fall into something that could be done with a bash command, I'd probably reach for perl over python for a quick and dirty disposable script.
This definitely interests me. How does perl surpass Unix tools? I guess perl has the benefit of handling the equivalent of sed and awk.
Sed:
perl -pe 's/foo/bar/' file1
Grep:
perl -pe '/foo/' file1
uniq:
perl -ne 'print unless $seen{$_}++' file1
But then you can combine conditions:
perl -ne 's/foo/bar/ if /baz/ && /yot/; print "Line number $. changed to $_"' file1
And do some awk-ish line splitting:
perl -F, -ane '$sum += $F[2]; END{ print "The sum of column 3 is $sum" }' file1
It absolutely flies in the face of the unix philosophy and is much more complicated than picking up each tool individually, but once you get to grips with 'em they're very handy.
https://unix.stackexchange.com/a/79656
perl -e 'for(<*>){((stat)[9]<(unlink))}'
seems to be the fastest possible way to delete enormous amounts of files
find -type f -print0 | xargs -0 rmA lot of forced indentation and absence of braces, and absence of sigils makes it harder to read Python scripts. However that's not the only problem with Python. If you are scripting you want the regular `unix_command` command thingy to work fine. More-so you want to read the output of that thing using a syntax like my @command_output = `unix_command`;
You also want heredocs. And you want multiline anonymous functions. I could go on and on.
But Python seems to be more like a tool trying to compete with Java than Perl.
One may also want to learn Perl5 for dealing with legacy stuff (either keeping or getting rid of it). There is a lot of it out there.
The second and more pivotal one liner was when I needed to create a primary key to ensure I wasn't getting any dupes later down the pipeline (a requirement that came about as some of the other contractors on the project were messing with my exports and then blaming my files for their conflicting numbers). My first approach was to use the MD5 tool included in GIT bash, but this was prohibitively slow, taking 45 mins to loop through each line of a 4mb file. Not sure if there was a performance penalty on the box I was using, but the perl one liner did the job in a couple of seconds for all the files I had.
After that it mostly became a question of maintainability, with the performance being a boosting factor. I found my perl deduping one liner was faster than either 'sort -u' or 'sort | uniq'. I was able to add new features and account for weird issues more easily. Regex was better than sed, syntax was more flexible than awk, there were more filtering options than grep.
Plus it was good fun. Perl has so many things that just feel so nice and tidy compared to bash.
Having said that, I still use Unix pipelines extensively, they just tend to be for ad hoc queries rather than for my automated reports.
There's an old quip that "perl is portable sed" - in my experience this is pretty true.
I discovered that git had bash installed quite early on, so my initial automation and reporting was based on UNIX pipelines. As the data volumes became bigger and the customer requirements became more demanding, I eventually bit the bullet and started learning perl one-liners to do some gymnastics that just weren't possible or practical with just bash (first big win was adding the MD5 of the line so that I could dedupe the obfuscated data).
This lead to eventually writing full scripts in perl and now I have basically all of my reporting automated, even able to take up some 'value add' reporting that I didn't think was going to be possible.
So yeah, not a new technology but I'm now a perl convert and will almost certainly use it in the future if I'm faced with a similar situation.