in reply to Perl advocacy

A couple of thoughts:

Incidentally, if you must include the regex, at least have pretty formatting so it looks nice:

$/ = ''; # paragrep mode while (<>) { while ( m{ \b # start at a word boundary (begin letters) ( # capture to $1 \S+ # one or more non-spaces ) # find chunk of non-whitespace \b # until another word boundary (end letters) ( # capture to $2 \s+ # separated by some whitespace \1 # whatever was in $1 \b # until another word boundary )+ # one or more sets of those }xig ) { print "dup word '$1' at paragraph $.\n"; } }

Just looking at that code, even when nicely formatted, makes me wince when I think about trying to convert anyone with it. Sure, we know what <>, $/, $., $1, and \1 mean, not to mention the /x, /i and /g modifiers on the regex, but those are going to scare the heck out of someone and make 'em long for Python or something.

If you show them some code, I think some 'baby Perl' would be a nice way to start.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.