Skip Menu |
Report information
Id: 847
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: qz [at]

Operating System: Linux
PatchStatus: (no value)
Severity: medium
Type: (no value)
Perl Version: (no value)
Fixed In: (no value)

Date: Mon, 7 Jun 1999 15:25:57 -0400
To: perlbug [...]
From: Elijah <qz [...]>
Subject: documentation bug: Regexp ref type not mentioned
Download (untitled) / with headers
text/plain 3.2k
----------------------------------------------------------------- [Please enter your report here] 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. --- perlfunc.pod.orig Fri Mar 5 14:10:56 1999 +++ perlfunc.pod Mon Jun 7 15:10:48 1999 @@ -2781,6 +2781,13 @@ HASH CODE GLOB + 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 [Please do not change anything below this line] ----------------------------------------------------------------- --- 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: Platform: 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 Compiler: 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: /usr/lib/perl5/5.00502/i586-linux /usr/lib/perl5/5.00502 /usr/lib/perl5/site_perl/5.005/i586-linux /usr/lib/perl5/site_perl/5.005 . --- Environment for perl 5.00502: HOME=/home/qz LANG (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/usr/local/bin:/usr/bin:/bin:.:/sbin:/usr/sbin:/usr/X11R6/bin:/usr/bin/mh PERL_BADLANG (unset) SHELL=/bin/ksh

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at