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
\ operator in scalar context #805
Comments
From mjtg@cus.cam.ac.uk If you prefer scalar context, similar chicanery is also useful for print "That yields ${\($n + 5)} widgets\n"; Version 5.004 of Perl had a bug that gave list context to the But simple experiments show that the bug is still present in 5.005_62. I recall this being discussed on p5p long ago, but can't find it in Of course, we must ensure that $refa = \@a; does the Right Thing. Note that there are subtleties in DB<1> @a = (4,5,6); DB<2> x \@a, \(@a) So it seems that \@a and \%a are special cases syntactically. And BTW, why is the next sentence of the FAQ written See also ``How can I expand variables in text strings?'' in this rather than as L<...> ? Mike Guy |
From @timbunceOn Wed, Nov 03, 1999 at 09:45:14AM +0000, M.J.T. Guy wrote:
That might have to be called a feature. Tim. |
From [Unknown Contact. See original ticket]Someone should look into the rest of this report as well, but this solves Inline Patch--- perlfaq4.pod Tue Oct 31 09:20:32 2000
+++ perlfaq4.new Wed Dec 13 14:13:37 2000
@@ -430,8 +430,7 @@
Version 5.004 of Perl had a bug that gave list context to the
expression in C<${...}>, but this is fixed in version 5.005.
-See also ``How can I expand variables in text strings?'' in this
-section of the FAQ.
+See L</"How can I expand variables in text strings?">
=head2 How do I find matching/nesting anything?
@@ -774,8 +773,7 @@
);
$text =~ s/\$(\w+)/$user_defs{$1}/g;
-See also ``How do I expand function calls in a string?'' in this section
-of the FAQ.
+See L</"How do I expand function calls in a string?">
=head2 What's wrong with always quoting "$vars"? |
@gbarr - Status changed from 'open' to 'resolved' |
From @gbarrIts the () that puts the expression into a list context. The \() just |
Migrated from rt.perl.org#1732 (status was 'resolved')
Searchable as RT1732$
The text was updated successfully, but these errors were encountered: