Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

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

I think those are two good points, but I think part of it is also just mindset of the programmers. Perl has a whole lot of functions that do similar things, as it borrows from many different languages. For instance, someone who's only dealt with perl might wonder why someone would ever do:

$string = join ( $replace, split ( $search, $string ) );

Which is roughly equivalent to:

$string =~ s/$search/$replace/g;

If you came from a language without regex matching, it makes perfect sense, though. You can use a person's choice of text output method to try to guess their background -- if you have almost all of the output coming from write, I'd assume that the programmer has a Fortran or similar background. if it's almost exclusively printf, then I'd assume they came from C. If it's all concatination without string interpolation, I'd assume something like JavaScript. I'm not going to be right every time, of course, but it seems that your thought processes about how to get things done is influenced by what tools to had available (or what tools you knew you had available, and you thought you knew how to use).

Personally, I did my time with Fortran, and I like the power of formats in it... but I don't think I've ever used write in perl. I'm more likely to use printf. One of these days, I'll actually get around to implementing a (s)printf that supports the LPC extensions like column mode, table mode, and arrays.

Oh -- and for 'nicely formatted' HTML, there's always preformatted text. After implementing it, the preformatted versions got more hits than the HTML table versions. (they even gave up on the table formatting ... too bad I never got preformatted promoted above the paragraph style)


In reply to Re^2: Do you use format and write? by jhourcle
in thread Do you use format and write? by pernod

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 studying the Monastery: (4)
As of 2024-04-25 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found