Don wrote:I suggest to Richard that you could just learn Perl and be done with it. Perl has powerful regular expressions, is a full scripting language and is just about as expressive as any language can be. You could write one-liners on the command line (without getting out the editor) with the -e switch which will do amazing things. And when a one-liner is not quite enough Perl let's you do amazingly powerful stuff in just a few lines of code.
At the risk of starting a language flamewar, s/perl/python/g. .
Seriously though, both Perl and Python are fantastic tools. Both would serve you very well.
Don wrote:I suggest to Richard that you could just learn Perl and be done with it. Perl has powerful regular expressions, is a full scripting language and is just about as expressive as any language can be. You could write one-liners on the command line (without getting out the editor) with the -e switch which will do amazing things. And when a one-liner is not quite enough Perl let's you do amazingly powerful stuff in just a few lines of code.
At the risk of starting a language flamewar, s/perl/python/g. .
Seriously though, both Perl and Python are fantastic tools. Both would serve you very well.
No flamewar, in fact I almost suggested other high level languages but wanted to keep it simple. I believe Perl is the one to reach for if you are looking for a "Swiss Army one-off Tool" for things like this.
I would suggest as a second choice, Ruby, then Python and there are others that would do a very similar good job for stuff like this. But I would use Ruby or Python if it were a larger project, Perl for these simple things. Of course you can build powerful systems with just Perl too, it's a very complete language.
I wrote a scrabble playing program in Perl using the Tk library for the graphics, the computer computes and plays a high scoring move. It was an amazingly short program, I can imagine the same thing in Java or C to be MUCH longer and complicated.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.