-
Notifications
You must be signed in to change notification settings - Fork 537
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
Labels
Comments
From qz@qz.toNeither perlop.pod nor perlfunc.pod mentions that qr// returns 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 @@
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 Perl Info
|
This was referenced Oct 18, 2019
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Migrated from rt.perl.org#847 (status was 'resolved')
Searchable as RT847$
The text was updated successfully, but these errors were encountered: