Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
unspec quotemeta, fixes #89
  • Loading branch information
labster committed Apr 24, 2015
1 parent 2f5fd80 commit 5d2e839
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions S02-bits.pod
Expand Up @@ -4235,8 +4235,8 @@ Any quoting form that includes C<qq> or C<:qq> in its semantic derivation
be considered meaningful. The meaning depends on whether the following
character is alphanumeric; if it is, the non-interpolating sequence produces
a compile-time error. If the character is non-alphanumeric, the backslash
is silently removed, on the assumption that the string was backslashed using
C<quotemeta()> or some such.
is silently removed, on the assumption that the string was erroneously
backslashed by an overenthusiastic algorithm or programmer.

=item 2.

Expand Down
17 changes: 14 additions & 3 deletions S29-functions.pod
Expand Up @@ -8,8 +8,8 @@ Synopsis 29: Builtin Functions

Created: 12 Mar 2005

Last Modified: 11 August 2014
Version: 62
Last Modified: 24 April 2015
Version: 63

The document is a draft.

Expand Down Expand Up @@ -819,7 +819,7 @@ gmtime, localtime, time
The following functions can now be found in or replaced by something in the String
module.

chop, chomp, index, lc, pack, quotemeta, rindex, split, sprintf, substr, uc,
chop, chomp, index, lc, pack, rindex, split, sprintf, substr, uc,
ucfirst, unpack

=head2 Obsolete Functions
Expand Down Expand Up @@ -891,6 +891,16 @@ Replaced by C<temp> which, unlike C<local>, defaults to not changing the value.
See L<S17/Concurrency>. C<lock> has been replaced by C<Lock.new> and methods
on the C<Lock> object.

=item quotemeta

Because regex escaping metacharacters can easily be solved by quotes
(L<S05/Simplified lexical parsing of patterns>), and variables are not
automatically interpolated (L<S05/Variable (non-)interpolation>), C<quotemeta>
is no longer needed.

Shell escaping should be handled by passing arguments to L<run>, or with code
that speaks the language of a specific shell.

=item pos

There is no C<pos> function in Perl 6 because that would not allow a string
Expand Down Expand Up @@ -1062,5 +1072,6 @@ wait
Tim Nelson <wayland@wayland.id.au>
Carlin Bingham <carlin@theintersect.org>
Elizabeth Mattijsen <liz@dijkmat.nl>
Brent Laabs <bslaabs@gmail.com>

=for vim:set expandtab sw=4:
16 changes: 2 additions & 14 deletions S32-setting-library/Str.pod
Expand Up @@ -9,8 +9,8 @@ DRAFT: Synopsis 32: Setting Library - Str

Created: 19 Mar 2009 extracted from S29-functions.pod

Last Modified: 2014-08-24
Version: 11
Last Modified: 2015-04-24
Version: 12

The document is a draft.

Expand Down Expand Up @@ -242,18 +242,6 @@ internal form for efficiency. I also think that compact classes
should be able to express their serialization in pack form if
asked for it with .packformat or some such. -law]

=item quotemeta

multi method quotemeta ( Str $string: --> Str ) is export

Returns the input string with all non-"word" characters back-slashed.
That is, all characters not matching "/<[A..Za..z_0..9]>/" will be preceded
by a backslash in the returned string, regardless of any locale settings.

[Note from Pm: Should that be "/\w/" instead? Or, if the intent
is to duplicate p5 functionality, perhaps it should be "p5quotemeta"?
Do we even want this method at all?]

=item rindex
X<rindex>

Expand Down

0 comments on commit 5d2e839

Please sign in to comment.