diff options
-rw-r--r-- | pod/perldelta.pod | 12 | ||||
-rw-r--r-- | pod/perlop.pod | 9 |
2 files changed, 18 insertions, 3 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 0de44db1fe..da8a24e91d 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -109,8 +109,16 @@ remains unchanged. See L<perlop>. =item Improved C<qw//> operator -The C<qw//> operator is now evaluated at compile time instead of being -replaced with a run time call to C<split()>. +The C<qw//> operator is now evaluated at compile time into a true list +instead of being replaced with a run time call to C<split()>. This +removes the confusing behavior of C<qw//> in scalar context stemming from +the older implementation, which inherited the behavior from split(). + +Thus: + + $foo = ($bar) = qw(a b c); print "$foo|$bar\n"; + +now correctly prints "3|a", instead of "2|a". =head1 Supported Platforms diff --git a/pod/perlop.pod b/pod/perlop.pod index 4b49808523..b386651eee 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -1046,7 +1046,14 @@ equivalent to: split(' ', q/STRING/); -the difference being that it generates a real list at compile time. +the difference being that it generates a real list at compile time. So +this expression: + + qw(foo bar baz) + +is exactly equivalent to the list: + + ('foo', 'bar', 'baz') Some frequently seen examples: |