A couple of thoughts:
- Drop the regex. It's practically unreadable and if any has heard of the FUD regarding Perl and linenoise, that will only encourage it.
- Go ahead and include the Amazon and eToys links. The odds are, many people who read your document will not follow your links.
- You mention that a company is thinking about adopting Perl as a development language. What sort of development? What are they trying to accomplish and how does Perl help them accomplish this? If they want device drivers or high-speed number crunching, Perl is not the best solution.
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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|