paragraph mode

L

Larry

Is there any exact definition of "paragraph mode", i.e.

$/ = '';

Everything I've seen has been somewhat vague. In particular, I am
noticing on ActiveState/Win32 that the Hex sequence "0d 0a 20 0d 0a"
is NOT being treated as a "paragraph boundary" (quite annoyingly).
For some reason the space character alone on a line invalidates it.
However, I am quite sure I have seen "0a 20 0a" treated as a
"paragraph boundary" under Linux (can't test it so easily right now).

What is the correct behavior?
 
T

Tad McClellan

Larry said:
Is there any exact definition of "paragraph mode", i.e.

$/ = '';


In perlvar.pod, where else?

Everything I've seen has been somewhat vague.


It seems pretty clear to me...

In particular, I am
noticing on ActiveState/Win32 that the Hex sequence "0d 0a 20 0d 0a"
is NOT being treated as a "paragraph boundary" (quite annoyingly).
For some reason the space character alone on a line invalidates it.


Because if there is a character on the line, then it is
not an empty line!

However, I am quite sure I have seen "0a 20 0a" treated as a
"paragraph boundary" under Linux (can't test it so easily right now).


I doubt it.

What is the correct behavior?


$/ The input record separator, newline by default. This influences
Perl’s idea of what a "line" is. Works like awk’s RS variable,
including treating empty lines as a terminator if set to the null
string. (An empty line cannot contain any spaces or tabs.)
 
J

Jorgen Grahn

....


I doubt it.

Yes; "Linux" most likely have no particular opinion about paragraphs.

On the other hand, emacs' backward-paragraph function /does/ treat a
line with a blankspace as a paragraph separator. I didn't expect it
to, but it did.

/Jorgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top