Help for this page

Select Code to Download


  1. or download this
    my($l_tablename, %l_data) = @_;
    my(@fields, @values);
    push(@fields, $_) && push(@values, $1_data{$_})
    ...
            VALUES (@values)
        );
    }
    
  2. or download this
    @list = ('arg1', ('field1' => 'value1', 'field2' => 'value2'));
    # above same as:
    @list = ('arg1', 'field1', 'value1', 'field2', 'value2');
    
    $table = shift(@list);  # 'arg1'
    %fields = shift(@list); # 'field1'
    
  3. or download this
        my $person = new MyDB::Person(4);
        $person->update(name => 'John B.');
    
  4. or download this
        &update('person', { pk => 4, name => 'John B.' });