Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: logging ftp log into mysql db...

by roboticus (Chancellor)
on Apr 01, 2006 at 17:12 UTC ( [id://540660]=note: print w/replies, xml ) Need Help??


in reply to logging ftp log into mysql db...

perlknight--

The other solutions are good, but your pseudocode suggests that you're looking for the functions seek() and tell(). Augmenting your pseudocode a little:

if new file { # read all lines and insert into db. # Save current position for next time... $current_line = tell(FH); } else if not new file { # Go to current line seek(FH,0,$current_line); # read all new lines and insert into db # Save position for next iteration... $current_line = tell(FH); }
--roboticus

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://540660]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-04-19 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found