Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

RE: rambling (deux)

by Corion (Patriarch)
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://17506]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2022-01-27 21:29 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (71 votes). Check out past polls.