Help for this page

Select Code to Download


  1. or download this
    $ perl -wMstrict -le 'if((2,1,0)) {print"true"}else{print"false"}'
    Useless use of a constant (2) in void context at -e line 1.
    false
    
  2. or download this
    $ perl -wMstrict -le 'if(()=(2,1,0)) {print"true"}else{print"false"}'
    true
    
  3. or download this
    $ perl -wMstrict -le 'sub foo { print wantarray?"list":"scalar";
      return (0); }; if(foo) {print "true"} else {print "false"} '
    ...
      return (0); }; my @x=foo;if(@x) {print "true"} else {print "false"}'
    list
    true