Chas, Tom, Martin -- thank you for all of your expertise and valuable insight to helping me understand the logic in the previous regex. As for where I saw this code, a friend of mine works for a company that has a unique approach of attracting coders. And I thought it might be a unique way of potentially attracting decent developers to my firm in the future. Anyway got the idea from here: http://www.fonality.com/careers.html
I didn't even bother with the second regexp, that's a bit obfuscated for my trivia needs. Deciphering the following: s;(?:SEEKING)?;PERLqny~%|fsyx%~tz&;?$^X=~m.\w+$. :DEVELOPERS;s"$&"Ktsf"i;s^.^chr ord($&)-5^eg;$\=$/;print||" ;) " - sf Tom Phoenix wrote: > On 5/11/07, Steve Finkelstein <[EMAIL PROTECTED]> wrote: > >> sflinux themes # echo 500 | perl -ple 's|(\d)|length(9 x $1)|eg;' >> 500 > >> essentially, (\d) should match just the '5' in 500. that puts $1 == the >> literal 5. so you take length(9 x 5) which is nine repeated 5 times, and >> the length of that is 5. That replaces the 5 with a ... 5? >> >> Is my logic correct on this? > > I think you've got it, except it doesn't stop with the 5. Unless I'm > missing something, that substitution means the same thing as this > simpler one: > > s#(\d)#$1#g > > Unless the value of $1 is useful, it's hard to see what good this > does. It replaces each digit with itself. As side effects it affects > all the match variables, and it stringifies its target. > > Did you find that piece of code somewhere? Do you know what its author > was trying to do? > > --Tom Phoenix > Stonehenge Perl Training > > !DSPAM:1020,4645243d773145414056337! > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/