Help for this page

Select Code to Download


  1. or download this
    $ perl -wE 'say (1 == 0) ? "Yes" : "No"'
    say (...) interpreted as function at -e line 1.
    ...
    
    $ perl -wE 'say +(1 == 0) ? "Yes" : "No"'
    No
    
  2. or download this
    $ perl -wle 'print (1 == 0) ? "Yes" : "No"'
    print (...) interpreted as function at -e line 1.
    ...
    Useless use of a constant ("No\n") in void context at -e line 1.
    $ perl -we 'printf +(1 == 0) ? "Yes\n" : "No\n"'
    No
    
  3. or download this
    $ perl -wle 'use constant X => "x"; my %x = (x => 42); print $x{X}'
    Use of uninitialized value in print at -e line 1.
    
    $ perl -wle 'use constant X => "x"; my %x = (x => 42); print $x{+X}'
    42
    
  4. or download this
    $ perl -wE 'sub f { @_ } say f(42)'
    42
    ...
    42
    $ perl -wE 'sub f { @_ } say +f(42)'
    42
    
  5. or download this
    $ perl -MO=Deparse,-p -e 'sub f { @_ } print f(42)'
    sub f {
    ...
    }
    print(f(42));
    -e syntax OK