#!/usr/bin/env perl -l
use strict;
use warnings;
my $shift = 'E';
my @x = \ (qw{A B C D});
test_shift(@x);
sub test_shift {
print ${+shift};
print ${shift()};
print ${shift @_};
print ${shift(@_)};
print ${shift};
}
####
Ambiguous use of ${shift} resolved to $shift at ./junk line 15.
A
B
C
D
E
##
##
$ perl -Mstrict -Mwarnings -le 'print (1==0) ? "true" : "false"'
print (...) interpreted as function at -e line 1.
Useless use of a constant ("true") in void context at -e line 1.
Useless use of a constant ("false") in void context at -e line 1.
$ perl -Mstrict -Mwarnings -le 'print +(1==0) ? "true" : "false"'
false
##
##
$ 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 }]
##
##
$ 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