summaryrefslogtreecommitdiff
path: root/perl9.buetow.org/content/Extended-Features.sub/Mixed-Contexes.xml
diff options
context:
space:
mode:
Diffstat (limited to 'perl9.buetow.org/content/Extended-Features.sub/Mixed-Contexes.xml')
-rw-r--r--perl9.buetow.org/content/Extended-Features.sub/Mixed-Contexes.xml10
1 files changed, 10 insertions, 0 deletions
diff --git a/perl9.buetow.org/content/Extended-Features.sub/Mixed-Contexes.xml b/perl9.buetow.org/content/Extended-Features.sub/Mixed-Contexes.xml
new file mode 100644
index 0000000..d6b2feb
--- /dev/null
+++ b/perl9.buetow.org/content/Extended-Features.sub/Mixed-Contexes.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
+<content>
+ <pagetitle>Perl 9 can now mix up contexes!</pagetitle>
+ <text>As you know from previous versions of Perl, you use the contexes void, list and scalar to program in. Now you are able to mix those together within the same variable!</text>
+ <code>
+my $@scaarr = ("Hello", (1, 2, 3, 4));
+$@scaarr.scalar.say; # Prints Hello
+local $, = ' '; $@scaarr.say; # Prints 1 2 3 4
+ </code>
+</content>