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);

2 Responses to “Perl things I always forget”

  1. RHPT Says:

    Really? Perl? What is this? 1996?

  2. steven Says:

    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.

Leave a Reply