Help for this page

Select Code to Download


  1. or download this
      $x = $x + 1 ;
    
  2. or download this
      $x = 0 ;
      $a[$x++] = $x ;       # $a[0] = 0  or  $a[0] = 1 ??
      $a[$x]   = $x++ ;     # $a[2] = 1  or  $a[1] = 1 ??
    
  3. or download this
      sub h { $_[0] = 1 ; return '!' ; } ; 
      $x = 0 ;
      $a[$x] = h($x) ;      # $a[0] = '!'  or  $a[1] = '!' ??
    
  4. or download this
      $x = $x + 1 ;        # or $x = $x++ ;
    
  5. or download this
      local $x = $x + 1 ;  # or local $x = $x++ ; (!)
    
  6. or download this
      sub d { $_[0] = 10 ; return 1 ; } ;
    
    ...
      print "\$x=$x.  \$x + d(\$x) = ", $x + d($x), "  \$x=$x\n" ;
      $x = 78 ;
      print "\$x=$x.  d(\$x) + \$x = ", d($x) + $x, "  \$x=$x\n" ;
    
  7. or download this
      sub d { $_[0] = 10 ; return 1 ; } ;
      sub o { print $_[1] ; return $_[0] ; } ;
    ...
      $x = 78 ;
      print "\$x=$x.  d(\$x) + \$x: " ;
        print o(d($x), 'LHS ') + o($x, 'RHS '), "  \$x=$x\n" ;