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 :
And here we have another way to do it :
1: #!/usr/bin/perl -w
2: print "Hello World\n";
3: exit 0;
4: #!/usr/bin/perl -w
5: print << X
6: Hello World
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 :
and now we need to predeclare some variables and initialize our defaults :
1: use strict;
2: use warnings;
3: use IO::Socket;
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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
Outside of code tags, you may need to use entities for some characters:
- 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
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] |