YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
|
|
@ -1,2 +1 @@
|
|||
my $_ = 3;
|
||||
print for $_**2, "\n", sqrt;
|
||||
print sqrt . " " for (4, 16, 64)
|
||||
|
|
|
|||
|
|
@ -1,17 +1,8 @@
|
|||
for ($_ = 0; $_ <= 9; $_++) {
|
||||
print "Outer";
|
||||
print "$_\n";
|
||||
# The inner loop will not nest properly unless
|
||||
# it is preceded by a my statement
|
||||
my $_; # This is required to nest the inner loop
|
||||
for ($_ = 0; $_ <= 9; $_++) {
|
||||
print "Inner";
|
||||
print "$_\n";
|
||||
}
|
||||
# Alternatively we can use a local keyword in the
|
||||
# inner loop declaration instead of a my statement
|
||||
for (local $_ = 0; $_ <= 9; $_++) {
|
||||
print "Alternative";
|
||||
print "$_\n";
|
||||
for (1..2) {
|
||||
print "outer $_:\n";
|
||||
local $_;
|
||||
for (1..3) {
|
||||
print " inner $_,";
|
||||
}
|
||||
print " fini\n";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue