Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 having an uproarious good time at the Monastery: (11)
As of 2014-12-21 11:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls