Apply transform

 | Perl | 0 Comments | 0 TrackBacks

Here's an interesting and very efficient way to transform each list element, returning the list of those modified copies:

my @nice_words =
    apply { s/$EXPLETIVE/[DELETED]/gxms } @words;

That is of course if you are willing to use the not-so well known List::MoreUtils CPAN module.

Give it a go.

No TrackBacks

TrackBack URL: http://www.kiffingish.com/cgi-bin/mt/mt-tb.cgi/4

Leave a comment

Recent Entries

Champion of Scotland
I nearly cried my eyes out when I discovered that young Tommy Morris dies in the prime of his
Sticky keyboard
Up until yesterday the Del-, Ins- and Home- keys on the upper right-hand corner were sticking alot, and it's
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