Help for this page

Select Code to Download


  1. or download this
    my @array = ( 'single result value' );
    my $wrong = @array;     # SCALAR CONTEXT
    ...
    __DATA__
    Wrong: 1
    Right: single result value
    
  2. or download this
      # we don't need this in the loop as we know when we increment (unles
    +s forking)
      # also syntax IS WRONG in original - need array context on LHS to ge
    +t val
    ...
                # exit if ($stop);  <--- never set in loop
        }
        close (READ);
    
  3. or download this
    # currently
    if ( DB query word exists in table ) {
    ...
    # will only use one query if it is an update (probably the most common
    + case)
    # and still only uses 2 for an insert.
    # this can yield savings -> 50% depending on Update:Insert ratio