in reply to Storing Info in a text File

If you assume that the last line has the highest ID you can:
my $line; open FH,"file.ext" or die $!; $line=$_ while(<FH>); close FH; #now the last line is in $line my($id)=split(/\|/,$line); #now you can use $id+1
If the highest ID can be anywhere in the file:
my $id; open FH,"file.ext" or die $!; while(<FH>){ my($nid)=split(/\|/); $id=$nid if $nid>$id; } close FH; #and again you use $id+1