package LinkDB; # Initialize the connection to the link db # Set up exporting of the database and form require Exporter; @ISA = qw(Exporter); @EXPORT = qw($db $form); # symbols to export by default @EXPORT_OK = qw(); # symbols to export on request use DBI; # Connect to database, turn on error reporting #our $db = DBI->connect("DBI:CSV:f_dir=db/"); our $db = DBI->connect('DBI:mysql:database=links', 'root', 'Timex42'); $db->{RaiseError} = 1; # Lets set up a shortcut form variable our $form = $::Request->Form; # Expand some quoted characters in a string sub unquote { my $str = shift; # \r characters are useless. $str =~ s/\\r//g; # Expand newlines $str =~ s/\\n/\n/g; # Expand backslashes... this should probably be last. $str =~ s/\\\\/\\/g; return $str; } 1; #-de -Dcc=gcc -Dprefix=/home/ieeecs/local -Uinstallusrbinperl