Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

demerphq's scratchpad

by demerphq (Chancellor)
on Jun 07, 2004 at 02:47 UTC ( #361850=scratchpad: print w/ replies, xml ) Need Help??

use Data::Consumer::Dir; use Getopt::Long; my ($db,$user,$name,$procs); Getoptions( 'db=s' => $db, 'user=s' => $user, 'name=s' => $name, 'procs=i' => $procs ) or die "Bad args"; my $pid= $$; fork while $procs-->0 and $pid==$$; my $feed= Data::Consumer::Dir->new( root => '/etc/drop/' ); my $DBH=DBI->connect($db,$user,$name) or die "..."; $feed->consume(sub { my ($f,$spec,$fh)= @_; while (<$fh>) { my @f=split/,/,$_; $dbh->do('insert into foo (date,height,width) values (?,?,?)',un +def,@f); } });
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2014-11-26 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (166 votes), past polls