[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
RE: [p5p] pod bugs
On Tue, 25 Jan 2000, Moore, Paul wrote:
> I think this is the crux of things. Specifically, from perldoc perlvar
>
> $/ The input record separator, newline by default. This is used
> to influence Perl's idea of what a "line" is. Works like
> awk's RS variable, including treating empty lines as
> delimiters if set to the null string. (Note: An empty
> line cannot contain any spaces or tabs.)
>
> That note is the key. Maybe the simple answer is "just" to change the effect
> of $/='' to split on empty lines, where empty matches /^\s*$/ rather than
> just /^$/.
Actually, I think the following paragraph is really the key: (further in
perlvar.pod):
Remember: the value of $/ is a string, not a regexp. AWK has to be
better for something :-)
I actually thought the standard library already contained a module for
"forgiving" paragraph reading, but can't find it now offhand. In lieu
of regexes for $/, such a module would probably be a nice thing to have.
Andy Dougherty doughera@lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
- Follow-Ups from:
-
Larry Wall <larry@wall.org>
- References to:
-
"Moore, Paul" <Paul.Moore@uk.origin-it.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]