Example code in perlfaq4.pod (under <<HERE
documents), should insert newline when '--' is
preceded by space[s], not otherwise. Example
uses \s*, which matches 0 or more spaces,
should be \s+ to match 1 or more spaces.:
($quote = <<' FINIS') =~ s/^\s+//gm;
...we will have peace, when you and all your
works have
perished--and the works of your dark master
to whom you
would deliver us. You are a liar, Saruman, and
a corrupter
of men's hearts. --Theoden in
/usr/src/perl/taint.c
FINIS
# I've added an additional print to show quote
before substitution of ' --'
print $quote . "\n\n";
$quote =~ s/\s*--/\n--/;
print $quote;
produces this:
...we will have peace, when you and all your works
have
perished--and the works of your dark master to
whom you
would deliver us. You are a liar, Saruman, and a
corrupter
of men's hearts. --Theoden in /usr/src/perl/taint.c
...we will have peace, when you and all your works
have
perished
--and the works of your dark master to whom you
would deliver us. You are a liar, Saruman, and a
corrupter
of men's hearts. --Theoden in /usr/src/perl/taint.c
Logged In: YES
user_id=451349
My first time to submit on SourceForge - probably
should have uploaded a text file to illustrate. I see the
wrap was pretty much lost on the web page.
--donls
Logged In: YES
user_id=3660
Thanks for the report. There are a *lot* of perl doc changes
slated for 5.8.0, and I am not going to apply only some of
them (except in limited fashion, like perlport, where it's
necessary) or all of them (too much work) to MacPerl 5.6.1.
However, I'll make sure the fix goes into perl 5.8.0 (a patch
has been submitted) so it will be picked up when MacPerl is
updated to 5.8.0, or if a user updates his local docs to the
5.8.0 docs.
Thanks,
--Chris