#!/usr/bin/perl # reg_ex_test.pl # run this script before repeatalyzer.pl # detects what macroclass each repeat belongs to # rep_units.txt is a list of all distinct types of repeats in the db # Perseus Missirlis - Mar 18, 2004 use strict; use DBI; # DBI my ($dsn) = "DBI:mysql:schz_db:athena.bcgsc.ca"; my ($user_name) = "schz_rw"; my ($password) = "repeat"; my ($dbh, $sth); my (@ary); ####################### # Connect to Database # ####################### $dbh = DBI->connect ($dsn, $user_name, $password, { RaiseError => 1 }); my $i = 1; while (<>) { chomp; if ($_ =~ /(\S+)/) { # print "line: 1 - Inserting: $1\n\n"; $sth = $dbh->prepare ("INSERT INTO rep_class VALUES(NULL,'$1')"); $sth->execute (); $i++; } } exit; # End script #