Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 chilling in the Monastery: (11)
As of 2014-07-31 20:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (253 votes), past polls