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...
start dat editing
directory is ./Members
files to process are ./Members/1.dat./Members/2.dat./Members/3.dat./Members/4.dat
start file ./Members/1.dat
write temp file /tmp/08yw9L8QjX
rename file /tmp/08yw9L8QjX to ./Members/1.dat
0rename error Invalid cross-device link
end file ./Members/1.dat...
My mistake, it's not deleting any of the lines, it just reorderd them.
Here's what I now get:
start dat editing
directory is ./Members
files to process are ./Members/1.dat./Members/2.dat./Members/3.dat./Members/4.dat./Members/5.dat
start file ./Members/1.dat
write temp file /tmp/nKijKk93AQ...
It looks like it is functioning but it doesn't actually delete the lines siteurl and sitename.
start dat editing
directory is ./Members
files to process are ./Members/1.dat./Members/2.dat./Members/3.dat./Members/4.dat./Members/5.dat
start file ./Members/1.dat
write temp file /tmp/WFTaSsK1ga...
Thanks for your patience.
This is the code and nothing happens:
#!/usr/bin/perl
use CGI::Carp fatalsToBrowser;
# Global information:
$theblahver = 16;
$version = $versioncr = '10.3.6'; # Said Version; Copyright version
$blanktarget = " target='_new'";
# Uncomment this for better time...
Sorry but no joy.
I did change this:
foreach $file (<*.dat>) {
to this:
foreach $file (<$members/*.dat>) {
as this is the folder the .dat files are in.
I pasted it at the top of another script and when run it just gives a HTTP 500 error.
I think I will need something more on the lines of:
open(FILE,"$members/$_.dat");
while(<FILE>) {
code
code
code
close(FILE);
}
or something along those lines.
Sorry for being so vague.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.