Front page | perl.perl5.porters |
Postings from July 2000
From: Jerrad Pierce
July 25, 2000 13:28
Message ID: 200007252029.QAA10897@cab-calloway.mit.edu
=item quotemeta EXPR
Returns the value of EXPR with all non-alphanumeric
characters backslashed. (That is, all characters not matching
C</[A-Za-z_0-9]/> will be preceded by a backslash in the
returned string, regardless of any locale settings.)
This is the internal function implementing
the C<\Q> escape in double-quoted strings.
If EXPR is omitted, uses C<$_>.
print $_ = quotemeta("/var/../\0tmp\n");
Now is this a feature, or what? The resulting string is rather different
from the input. I don't remember embedding any tabs...
Okay, so it's not really a tab. (un)fortunately perl does seem to be
protecting the resulting string. But this doesn't seem right...
I'd have expected either:
\/var\/\.\.\/tmp OR \/var\/\.\.\/\0tmp
At the very least shouldn't the dox indicate that null is a special case?
Are there any others?
* __ * .
\ | / . . . . . ((_
_____ . . .
-- / \ -- . . . + . . _/\
oooooooooo. | * . . . * / ;M\_ .
.oooooooooooo.oo. . . . . /\ . / :IMM\
..oooooooooooo..oo. Jerrad Pierce /\ / \ / ;IIWMM
..oooooooooo....... 209 North Street + / \ / \ . / ;IIIIWM
...ooooooooo....... Randolph, MA 02368 / \ \ ___/ :;IIIIIWM
....ooo....o....... / \ \ / :: ;;IIIMI
.....ooo......... http://www.pthbb.org / \ \ : :::;IIIM
..ooooooo.... __________________________ || || ::.....::::::
MOTD on Sweetmorn, the 60th of Confusion, in the YOLD 3166:
If you have tears shed them now
by Jerrad Pierce