- or download this
#!/usr/bin/env perl -l
...
print ${shift(@_)};
print ${shift};
}
- or download this
Ambiguous use of ${shift} resolved to $shift at ./junk line 15.
A
...
C
D
E
- or download this
$ perl -Mstrict -Mwarnings -le 'print (1==0) ? "true" : "false"'
print (...) interpreted as function at -e line 1.
...
$ perl -Mstrict -Mwarnings -le 'print +(1==0) ? "true" : "false"'
false
- or download this
$ perl -Mstrict -Mwarnings -MData::Dump -e 'dd [map { my $y = uc; {$y
+=> 1} } "a".."c"]'
["A", 1, "B", 1, "C", 1]
$ perl -Mstrict -Mwarnings -MData::Dump -e 'dd [map { my $y = uc; +{$y
+ => 1} } "a".."c"]'
[{ A => 1 }, { B => 1 }, { C => 1 }]
- or download this
$ perl -Mstrict -Mwarnings -le 'use constant X => "a"; my %h = (a => 1
+); print $h{X}'
Use of uninitialized value in print at -e line 1.
$ perl -Mstrict -Mwarnings -le 'use constant X => "a"; my %h = (a => 1
+); print $h{+X}'
1