Posts

Showing posts with the label perl

Why Perl...

Image
/via http://www.commitstrip.com/en/2018/06/22/are-you-any-good-at-it/ I still remember discovering perl back in 1991. I was one of two Unix Guys at Notre Dame back then, and we were responsible for managing a metric ton of SPARCstations, AFS, remote booting, and all sorts of weird-ass s**t that, luckily, most of us just don’t have to worry about anymore. And yeah,  so  much of everything was run using a cobbled together collection of  csh  ( bash wasn’t huge back then). Perl was a godsend, simplifying  so  much of the nasty text processing that was intrinsic to the sysadmin stuff we used to do back then. Mind you, most of this was because it beat the pants off of  csh , and that was good enough for us! Years went by, and perl just became a core part of my toolkit — to the point that we pretty much ran a telco for over 10 years with most of the management/automation (what we’d call DevOps these days!) done in perl,  and it worked . In...

Erlang and perl - my favorite tools (erlperl? perlang?)

Image
The two languages I am most comfortable with nowadays are erlang/OTP and perl - which, strangely enough, makes me quite remarkably non -conflicted.  The key, I guess, is that they are so different, with the core use-cases being so fundamentally distinctive, that there really isn't that much of a context switch for me to move from one to the other.  And, of course, given their radically different natures, I rarely (never?) ever use one when I should have used the other. Erlang/OTP, of course, is your classic massively concurrent fault-tolerant distributed infrastructure language, which pretty much gives you all the aforesaid buzz-word properties by default.  You have to work, and quite hard at that, at making your system behave badly.   I could go on and on about why its the greatest thing ever, but others have done it far better (e.g. John Bender here or Alex here ), but I will say that once you have tested the beauty of the built-in concurrency, sup...

And Now For Some Really Basic Perl - JSON Manipulation

And Now For Some Really Basic Perl - JSON Manipulation In PerlWorld, there are basically two ways of doing virtually anything. a) Do it yourself b) Go look at CPAN and realize that Someone Has Done It Better Being a card-carrying member of approach (b) above, here's a remarkably simple way of mainpulating JSON in PerlWorld First, for some code based on Marc Lehmann's truly excellent JSON module # Include the JSON module use JSON::XS; # Create a thing (called $json) that will be used to encode JSON strings $json = JSON::XS->new(); # Make sure that the resultant JSON will print out all nice and pretty $json->pretty(1); # Create a basic JSON hash $jsonStructure->{id} = "1234"; $jsonStructure->{method} = "ReallyCoolMethod"; $jsonStructure->{version} = "1.0.1"; # $prettyJSON will contain the text string which is the Oh-So-Pretty version of $jsonStructure $prettyJson = $json->encode($jsonStructure); If you printed out the contents of $...