Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl -l
    
    ...
        print ${shift(@_)};
        print ${shift};
    }
    
  2. or download this
    Ambiguous use of ${shift} resolved to $shift at ./junk line 15.
    A
    ...
    C
    D
    E
    
  3. 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
    
  4. 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 }]
    
  5. 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