while(my $row = read_row_from_xml($input)) { $db->insert(mytable => $row); } #### { 'foo' => 123, 'bar' => 456, 'comment' => 'This is plain text', # NOT escaped 'undefined' => undef, # becomes NULL }