Subject: | perldoc -F doesn't correctly handle filenames containing single quotes |
1) see a link to http://www.pair.com/~comdog/brian's_guide.pod in the
Planet Perl feed.
2) get annoyed reading it as plain text
3) try perldoc http://www.pair.com/~comdog/brian's_guide.pod
4) try perldoc http://www.pair.com/~comdog/brian%27s_guide.pod
5) try perldoc -F http://www.pair.com/~comdog/brian%27s_guide.pod
6) wget http://www.pair.com/~comdog/brian's_guide.pod
7) perldoc -vF brian's_guide.pod
8) output includes: sh: Syntax error: Unterminated quoted string
9) file is displayed as plain text
I've attached a patch against Perldoc.pm 3.14_07 that allows it to grok
filenames with embedded single quotes. I've only tested it on Linux.
There are other things that perldoc -F mishandles on various platforms
(e.g. spaces). tweak_found_pathnames() is rather light on tweaks. It'd
be nice if File::Spec included some sort of escape (or quote or
normalize) function...
chocolateboy.
P.S. The "return;" statement at the end of tweak_found_pathnames() and
various other subs can probably be removed :-)
Subject: | perldoc.patch |
--- Perldoc.pm 2008-07-02 21:43:15.000000000 +0100
+++ Perldoc.pm 2008-07-02 21:26:27.000000000 +0100
@@ -1747,6 +1747,7 @@
if (IS_MSWin32) {
foreach (@$found) { s,/,\\,g }
}
+ foreach (@$found) { s,',\\',g }
return;
}