Tuesday, May 22, 2012

Learning Perl.. on a Mac

One of the nice things about Mac OS X is that, because it is a UNIX descendent, it has things like Perl and Bash built into it (at least, I think it is bash..). My inner *nix geek can happily geek out in the terminal window with pipes and shell scripts and whatnot.

I'm starting to use my Mac a bit more because I plan to start co-developing for both Android and iOS. It's a late-2006 model iMac –  one of the last of the white polycarbonate-enclosed iMacs. I bought it way back when I was working at Microsoft in the Windows org, and wanted to at least get an idea for myself of real comparison between Windows and Mac at that time instead of relying on silly TV commercials telling me what to think.  For what it's worth, the iMac has generally performed favorably, especially considering how long it's been in use, so I'd say it was definitely worth the $1200 or so that I spent on it initially. I did have to take it in to the local Apple store to have the screen replaced at one point due to vertical lines popping up all over the place, but other than that, it's aged pretty well. It still works –  a little slower and less powerful than the beefy workstation I do most of my work on, but still pretty usable. And it takes up very little space, which makes it a great secondary computer. Its purpose now is to serve as my iOS build and debugging machine.

I'm also starting to really dive into Perl, because, well, it's a useful language to know, or so I've been told. I think it might be interesting to write a game in Perl, maybe a text adventure that scours your hard drive for plain text files and mad libs in some of the most commonly used words it finds :) That aside, it's always useful to learn new programming languages with different programming styles to broaden one's perspective. And somehow, I got all the way through a UNIX-based computer science education without learning Perl. Time to fix that.

Since the iMac never really gets turned off, because it's quiet and off enough idling in sleep mode, it's easy enough to just start typing away on it in the morning while I'm reading the llama book. My inner UNIX geek uses VI, so I've put mvim on the system and use that for editing scripts. The scripts I've been writing so far have been building up gradually from the 'hello world' into the basic arithmetic and string operations into lists and arrays and so on –  a familiar sequence and a useful one in relating the specifics of the language to what I already know. 

I've also signed up for the perl-beginners mailing list, and have been getting this daily deluge of mail threads on various questions which, if really beginner level, must mean that I am a total newb at this language and have a lot to learn.

No comments:

Post a Comment