Shall I save you the trouble :)
my @line;
open F, "</path/to/links.db" or die $!;
open O, ">/path/to/links.db.new" or die $!;
while (<F>) {
$i++;
chomp;
@line = split /\|/;
shift @line;
print O "$i|" . join("|", @line) . "\n";
}
close O;
close F;
open L, ">/path/to/linkid.txt" or die $!;
print L $i;
close L;
..that isn't tested but has a 75% chance of working
Code:
my $i; my @line;
open F, "</path/to/links.db" or die $!;
open O, ">/path/to/links.db.new" or die $!;
while (<F>) {
$i++;
chomp;
@line = split /\|/;
shift @line;
print O "$i|" . join("|", @line) . "\n";
}
close O;
close F;
open L, ">/path/to/linkid.txt" or die $!;
print L $i;
close L;
..that isn't tested but has a 75% chance of working