Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading a file

Status
Not open for further replies.

martinjburgess

IS-IT--Management
Jun 8, 2012
21
GB
Hi,

I would like to open and read a file that is in this format:

Time|Username|Email|IP

for example:

1345289299|Test|stinesofe@changesmile.org.ua|82.45.104.76

After reading a form input that includes $username and $ip, if the Email or IP are not listed in the file, then I would like to add these to the bottom of the file.

So:
open a file called spamlog
read the file
if either the IP or Email from the form exist then ignore
if either the IP or Email from the form are not listed the append the file with the new values.

Many thanks in advance.
 
What is your question? What have you tried and where are you stuck? Picking a random google result for "perl read file split fields", something like this page should get you started.

Annihilannic
[small]tgmlify - code syntax highlighting for your tek-tips posts[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top