Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.


In reply to (Ovid) Re: Perl advocacy by Ovid
in thread Perl advocacy by tinman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-19 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found