Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH 5.6.0] perlop: $( does not interpolate #1923

Closed
p5pRT opened this issue May 2, 2000 · 4 comments
Closed

[PATCH 5.6.0] perlop: $( does not interpolate #1923

p5pRT opened this issue May 2, 2000 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented May 2, 2000

Migrated from rt.perl.org#3193 (status was 'resolved')

Searchable as RT3193$

@p5pRT
Copy link
Author

p5pRT commented May 2, 2000

From newton@ficus.frogspace.net

Created by newton@newton.digitalspace.net

The configuration information at the bottom is irrelevant because this is just
a doc patch (I still use 5.005_03 but suppose that doc patching is best against
the newest version).

perlop.pod, in the section '=item m/PATTERN/cgimosx' / '=item
/PATTERN/cgimosx', mentions that $) and $| will probably not be interpolated.

Later on, in section '=item C<?RE?>, C</RE/>, C<m/RE/>, C<s/RE/foo/>', $( is
added to that group ("C<$|>, C<$(>, and C<$)> are not interpolated").

This patch updates the first section to also mention C<$(>.

Inline Patch
--- perlop.pod~ Sun Mar 19 07:17:07 2000
+++ perlop.pod  Tue May  2 12:46:28 2000
@@ -788,14 +788,14 @@
 
 PATTERN may contain variables, which will be interpolated (and the
 pattern recompiled) every time the pattern search is evaluated, except
-for when the delimiter is a single quote.  (Note that C<$)> and C<$|>
-might not be interpolated because they look like end-of-string tests.)
-If you want such a pattern to be compiled only once, add a C</o> after
-the trailing delimiter.  This avoids expensive run-time recompilations,
-and is useful when the value you are interpolating won't change over
-the life of the script.  However, mentioning C</o> constitutes a promise
-that you won't change the variables in the pattern.  If you change them,
-Perl won't even notice.  See also L<"qr//">.
+for when the delimiter is a single quote.  (Note that C<$(>, C<$)>, and
+C<$|> might not be interpolated because they look like end-of-string
+tests.) If you want such a pattern to be compiled only once, add a C</o>
+after the trailing delimiter.  This avoids expensive run-time
+recompilations, and is useful when the value you are interpolating won't
+change over the life of the script.  However, mentioning C</o> constitutes
+a promise that you won't change the variables in the pattern.  If you
+change them, Perl won't even notice.  See also L<"qr//">.
 
 If the PATTERN evaluates to the empty string, the last
 I<successfully> matched regular expression is used instead.


End of patch.
Perl Info


Site configuration information for perl 5.00503:

Configured by frogleg at Sun Aug  8 13:32:51 EDT 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=5.2, archname=i686-linux
    uname='linux ficus.frogspace.net 2.2.6-ac3 #2 thu aug 5 09:35:04 edt 1999 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O2', gccversion=2.7.2.3
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    


@INC for perl 5.00503:
    /usr/local/lib/perl5/5.00503/i686-linux
    /usr/local/lib/perl5/5.00503
    /usr/local/lib/perl5/site_perl/5.005/i686-linux
    /usr/local/lib/perl5/site_perl/5.005
    .


Environment for perl 5.00503:
    HOME=/home/newton
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/sbin:/home/newton:.
    PERL_BADLANG (unset)
    SHELL=/bin/bash


@p5pRT
Copy link
Author

p5pRT commented May 2, 2000

From [Unknown Contact. See original ticket]

"Philip Newton,,," <newton@​ficus.frogspace.net> wrote
  [ patch for documentation of $( in patterns ]

I thought I'd sent a patch for this ages ago. Obviously I didn't get
round to it. Or it got lost. Or something. :-(

+C<$|> might not be interpolated because they look like end-of-string

While you're patching, change that 'might not be' to 'are not', since they
never are interpolated.

Mike Guy

@p5pRT
Copy link
Author

p5pRT commented May 3, 2000

From [Unknown Contact. See original ticket]

On Tue, 2 May 2000, M.J.T. Guy wrote​:

While you're patching, change that 'might not be' to 'are not', since they
never are interpolated.

Sure. This makes the patch shorter, too :-)

Inline Patch
--- perlop.pod~ Sun Mar 19 07:17:07 2000
+++ perlop.pod  Wed May  3 10:31:03 2000
@@ -788,8 +788,8 @@
 
 PATTERN may contain variables, which will be interpolated (and the
 pattern recompiled) every time the pattern search is evaluated, except
-for when the delimiter is a single quote.  (Note that C<$)> and C<$|>
-might not be interpolated because they look like end-of-string tests.)
+for when the delimiter is a single quote.  (Note that C<$(>, C<$)>, and
+C<$|> are not interpolated because they look like end-of-string tests.)
 If you want such a pattern to be compiled only once, add a C</o> after
 the trailing delimiter.  This avoids expensive run-time recompilations,
 and is useful when the value you are interpolating won't change over


End of patch.

Cheers,
Philip

@p5pRT
Copy link
Author

p5pRT commented May 7, 2000

From @ysth

In article <E12mbmZ-00017X-00@​ursa.cus.cam.ac.uk>,
"M.J.T. Guy" <mjtg@​cus.cam.ac.uk> wrote​:

"Philip Newton,,," <newton@​ficus.frogspace.net> wrote

+C<$|> might not be interpolated because they look like end-of-string

While you're patching, change that 'might not be' to 'are not', since they
never are interpolated.

${|}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant