Closed p5pRT closed 20 years ago
I assume (hope) this is an old and oft-submitted request.
POD should be indentable. Perl is white-space tolerant; why should POD be different.
The Camel sayeth:
...files...may contain dollops of pod sprinkled about wherever the author feels like it. Perl simply skips pover the pod text when parsing the file for execution.
I say: if I can't indent it\, it ain't :wherever I feel like it".
The Camel sayeth:
The Perl lexer knows to begin skipping when\, at a spot where it would ordinarily find a statement\, it instead finds a line beginning with an equal sign and an identifier".
I say "That's misleading and not true..."
Let's get nit-picky about "beginning with".
Comments "begin with" a #. But\, that statement does not imply that comments MUST begin in column 1!
If I can indent these statements
# x is cool
$x = 25;
Why can't I indent
=head ... =cut
If nothing preceeds the statement (pod) except (invisible to Perl) white space... why can't I indent pod?
Sayeth the Camel: This allows you to intermix your source code and documentation freely.
Nay\, not freely. My documentation commands must be left-justified in column 1. At no other time is Perl so heavy-handed.
I thought I had done with Column 1 when I left FORTRAN behind.
Pod isn't... well...\, very Perlish.
On Jan 8\, vicki.brown@barclaysglobal.com said:
POD should be indentable. Perl is white-space tolerant; why should POD be different.
How\, then\, would you differentiate between paragraphs and as-is text?
=head1 Foo
This is a paragraph
this is as is text
=cut
Would Perl have to keep track of the indentation of the POD directives?
=head1 Foo
This is a paragraph
this is as is text
=cut
On Mon\, Jan 08\, 2001 at 01:28:39PM -0800\, vicki.brown@barclaysglobal.com wrote:
The Perl lexer knows to begin skipping when\, at a spot where it would ordinarily find a statement\, it instead finds a line beginning with an equal sign and an identifier".
I say "That's misleading and not true..."
Let's get nit-picky about "beginning with".
Comments "begin with" a #. But\, that statement does not imply that comments MUST begin in column 1!
Comments aren't lines.
Comments begin with a "#". That's correct. The beginning of a comment has to be a # sign\, which is just as well\, because I don't want things *before* the # sign being treated as a comment. For POD\, lines must begin with a "=". There must be nothing on a line before an "=". I think that's perfectly clear.
Now\, what isn't clear to me at all is what happens in this case:
$a
=begin ;
print $a;
Perl prints "begin". But it shouldn't.
On Jan 8\, Simon Cozens said:
Now\, what isn't clear to me at all is what happens in this case:
$a
=begin ;
print $a;
Perl prints "begin". But it shouldn't.
Not so. POD directives start where Perl is expecting a new statement.
"The Perl lexer knows to begin skipping when\, at a spot where it would ordinarily find a statement\, it instead encounters a line beginning with an equal sign and an identifier..."
-- Camel 3
-----Original Message----- From: Simon Cozens [mailto:simon@cozens.net] > Comments aren't lines.
Statements aren't "lines" either.
... The Perl lexer knows to begin skipping when at a spot where it would normally find a statement...
Column 2 is such a "spot". So is column 29. Iff preceded by whitespace. Iff we're talking statement. Or comments. Or anything but... pod.
> There must be nothing on a line before an "=". I think that's perfectly clear.
Oh\, it's perfectly clear. I never said it wasn't clear.
I said I think it's wrong :-)
From: Jeff Pinyan [mailto:jeffp@crusoe.net] Sent: Monday\, January 08\, 2001 13:45
On Jan 8\, vicki.brown@barclaysglobal.com said:
>POD should be indentable. Perl is white-space tolerant; why should POD be >different.
How\, then\, would you differentiate between paragraphs and as-is text?
=head1 Foo
This is a paragraph
this is as is text
=cut
The way it's done now. The beginning of a here document can be indented. _Commands_ can be indented."As is text" can't be indented.
Let's bear in mind the difference between data and program. Program should be white-space tolerant.
Would Perl have to keep track of the indentation of the POD directives?
No. I'm asking for whitespace to be ignored in Perl "command lines". Thus the "level of indentation" is not at issue - because the amount of white space should be ignored along with the fact of the whitespace.. This is Perl we're discussing\, not Python :-)
- Vicki
Migrated from rt.perl.org#5124 (status was 'resolved')
Searchable as RT5124$