Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I don't think we need line numbering. In the Code catacombs, there already is automatic line numbering, and for the rest of the sections, automatic line numbering would be confusing since there is no way to reference line numbers from the text. Two examples :

Here we have the trivial hello world program :

1: #!/usr/bin/perl -w 2: print "Hello World\n"; 3: exit 0;
And here we have another way to do it :
4: #!/usr/bin/perl -w 5: print << X 6: Hello World 7: X

In the above case, restarting line numbering would have been the right thing, as the above code are really two programs. But always restarting line numbering is also a bad idea :

First, we need to include some modules and pseudo-modules :

1: use strict; 2: use warnings; 3: use IO::Socket;
and now we need to predeclare some variables and initialize our defaults :
1: my $port, $host; 2: $host = shift || "localhost"; 3: $port = shift || 8000;
Here, it would be better to have the line numbers continue.

As for the syntax highlighting, currently the <CODE>-tags are used for almost all preformatted stuff, also for HTML stuff etc., but maybe it would be interesting to have syntax highlighting. But from what I see, syntax highlighting is far from trivial, since you will more or less need a Perl parser for that, as Perl cannot be parsed by line or by keywords, and strings have at least three different possibilitie

In reply to RE: rambling (deux) by Corion
in thread rambling (deux) by ar0n

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (3)
    As of 2021-01-27 01:42 GMT
    Find Nodes?
      Voting Booth?