Eeek....that isn't going to work for sure :)
You will need something like:
print "Content-type: text/plain\n\n";
open(IN, "data/links.db") or &cgierror("unable to open data file. Reason: $!");
open(NEW, ">data/links.db.new") or &error("unable to open data file. Reason: $!");
while (<IN>) {
chomp;
split /\|/;
print NEW join('|', @_);
if ($_[6] =~ /\.(gif|swf)$/) {
print NEW "|$1";
print "Updated record $_[0].....added $1\n";
next;
}
print NEW "\n";
}
close NEW;
close IN;
It will need to go in your admin directory.
You will need something like:
Code:
#!/usr/bin/perl print "Content-type: text/plain\n\n";
open(IN, "data/links.db") or &cgierror("unable to open data file. Reason: $!");
open(NEW, ">data/links.db.new") or &error("unable to open data file. Reason: $!");
while (<IN>) {
chomp;
split /\|/;
print NEW join('|', @_);
if ($_[6] =~ /\.(gif|swf)$/) {
print NEW "|$1";
print "Updated record $_[0].....added $1\n";
next;
}
print NEW "\n";
}
close NEW;
close IN;
It will need to go in your admin directory.