Help for this page

Select Code to Download


  1. or download this
    my $statement = qq(
               INSERT INTO dickens VALUES ($word, $Line{$word})
            );
    
  2. or download this
    my $sth = $dbh->prepare('INSERT INTO dickens VALUES(?, ?)');
    
    # and then, as often as you want:
    $sth->execute($line, $count);
    
  3. or download this
       CREATE TABLE dickens (
               word VARCHAR(30),
               line INTEGER,
       );
    
  4. or download this
    foreach $word ( @theseWords ) {
       my @lines = split m/ ,/, $Line{$word};
    ...
          $sth->execute($word, $_);
       }
    }