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

documentation bug: Regexp ref type not mentioned #45

p5pRT opened this issue Jun 7, 1999 · 1 comment

documentation bug: Regexp ref type not mentioned #45

p5pRT opened this issue Jun 7, 1999 · 1 comment


Copy link

p5pRT commented Jun 7, 1999

Migrated from (status was 'resolved')

Searchable as RT847$

Copy link

p5pRT commented Jun 7, 1999


Neither perlop.pod nor perlfunc.pod mentions that qr// returns
a ref to the compiled regular expression. These patches fix that.
Additionally, I've expanded the explanation of ref() to comment
on how to create each type of reference.

Inline Patch
--- perlfunc.pod.orig	Fri Mar  5 14:10:56 1999
+++ perlfunc.pod	Mon Jun  7 15:10:48 1999
@@ -2781,6 +2781,13 @@
+    Regexp
+References of types REF, ARRAY, HASH, and GLOB are simple to get with the
+C<\> referencing operator. References to CODE come from anonymous 
+function declarations (see C<sub>). SCALAR references come from such
+constructs as C<$sref = \substr($_, 3, 4);>.  References to regular
+expressions are the printable results returned by the C<qr//> operator.
 If the referenced object has been blessed into a package, then that package
 name is returned instead.  You can think of C<ref()> as a C<typeof()> operator.

--- perlop.pod.orig	Fri Mar  5 14:10:56 1999
+++ perlop.pod	Mon Jun  7 15:21:21 1999
@@ -910,7 +910,9 @@
 =item qr/STRING/imosx
 A string which is (possibly) interpolated and then compiled as a
-regular expression. The result may be used as a pattern in a match
+regular expression. The result is a printable string that is a
+reference to the compiled regular expression. It may be used as
+a pattern in a match
     $re = qr/$pattern/;
     $string =~ /foo${re}bar/;	# can be interpolated in other patterns
Perl Info

Site configuration information for perl 5.00502:

Configured by root at Thu Mar  4 19:46:56 EST 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
    osname=linux, osvers=2.0.30, archname=i586-linux
    uname='linux qz 2.0.30 #1 wed jun 4 15:02:33 edt 1997 i586 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
    cc='cc', optimize='-O2', gccversion=2.8.0
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include -DDEBUGGING'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include -DDEBUGGING'
    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='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lndbm -lgdbm -ldb -ldl -lm -lc
    libc=/lib/, so=so, useshrplib=true,
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.00502/i586-linux/CORE'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl 5.00502:

Environment for perl 5.00502:
    LANG (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

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

No branches or pull requests

1 participant