This idiom, I love it so much but I use it fairly infrequently, but it’s absolutely gorgeous
#Assign to another variable the result of a RegEx]
($new= $old) =~ s|foo|bar|g;
And this one I just forget, because I tend to use hashes
#Remove element from an array based on index:
splice(@array,
3,
1);
This entry was posted
on Wednesday, August 13th, 2008 at 5:00 pm and is filed under Technology and Computers.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
August 14th, 2008 at 6:35 pm
Really? Perl? What is this? 1996?
August 14th, 2008 at 8:16 pm
You’ll notice a strong correlation between companies that have legacy software needing migration just about now with companies that got big fast in the late 90’s early 00’s and Perl. I happen to work at one of those companies.
On the other hand, when I need to develop something on the CLI fast, I go for the language I wind up using the most and that stays out of the way the most. Were I to write something like I demonstrated in the How I Write Perl post in Ruby or Python, it would be as much an exercise in my infrequently–used other language as much as in getting a program to do what I need done. In short, it would open the door to some serious yak-shaving. So, Perl it is.