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

RE: rambling (deux)

by Corion (Pope)
on Jun 10, 2000 at 14:45 UTC ( #17506=note: print w/replies, xml ) Need Help??

in reply to rambling (deux)

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

Replies are listed 'Best First'.
RE: RE: rambling (deux)
by ar0n (Priest) on Jun 11, 2000 at 00:58 UTC
    oops, i guess i should read a little more! thanks :-)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://17506]
and the questions are moot...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2017-05-26 18:25 GMT
Find Nodes?
    Voting Booth?