Array one liner replacement

 | Perl | 0 Comments

By far the most efficient way to do a global in line replacement on an array is by using the following substitution one liner:

s/apples/oranges/ for @entries;

Why go through all of the trouble of using a for loop when you can impress your family and friends by doing it so much more elegantly?

Leave a comment

Recent Entries

Perl on steroids
Read this from beginning to end, and you then tell me with a straight face that it hasn't completely
Seventh Dutch Perl Workshop
Going to attend the 7th Dutch Perl Workshop tomorrow in Arnhem. Cannot wait to get up bright and early
Relevant experience
I was pleasantly surprised to discover the following exciting email in my inbox this morning. Good Day, My name
No comment
Sometimes after a long and weary day at work you just do not feel like making any comments. @no_comments
Magic white pills
Those little white pills that Thea brought home for me the other day from her work are amazing. Although