Help for this page

Select Code to Download


  1. or download this
    my @v= keys %h;
    die "Got extra Z: @v\n" if @v >1
    
  2. or download this
       
      DB<100> sub check { die "Got extra Z: @_\n" if @_ >1 }
    
    ...
    
      DB<104> check my @v= keys %h
    Got extra Z: a b
    
  3. or download this
      DB<106> sub avoid (&;@) { 
               my $code=shift;
    ...
      DB<109> avoid { "Got extra Z: @_\n" if @_ >1 } my @v = keys %h;
    
      DB<110>
    
  4. or download this
    avoid { "Got extra Z: @_\n" if @_ >1 } 
        my @v = keys %h;
    
  5. or download this
           The declared variable is not introduced (is not visible) until 
    +after
           the current statement.  Thus,
    ...
               my $x = 123 and $x == 123
    
           is false unless the old $x happened to have the value 123.