Gossamer Forum
Home : Products : DBMan : Customization :

Question about archive

Quote Reply
Question about archive
Hi! I was wondering where to insert this line that reference to a subrountine I created. that subroutine would generate a random number. I need this random nunber to be generated for each record that is archived. I tried to insert it where it is shown in red but it caused the subsequent archived records to have the randowm number appended to the newly generated random number. Meaning for example, the first record that is archived would have a 9 digit number, then the second record that is archived would hve 18 numbers and so on. I want for each archived record to have a unique 9-digit number generated from my own subroutine. Can someone plaese help me point in the right direction?

LINE: foreach $line (@lines) {
if ($line =~ /^$/) { next LINE; }
if ($line =~ /^#/) { $output .= $line; next LINE; }
chomp ($line);
@data = &split_decode($line);
if ($archive_list{$data[$db_key_pos]}) {
$archive_list{$data[$db_key_pos]} = 0;
if ($data[14] eq "Graduated" && $db_setup eq "academy") {

open (ARC, ">>$db_garchive_name") or &cgierr("error in archive_record. unable to open database: $db_garchive_name.\nReason: $!");
if ($db_use_flock) {
flock(ARC, 2) or &cgierr("unable to get exclusive lock on $db_garchive_name.\nReason: $!");
}
foreach $data (@data) {
$data =~ s/^\s+//g; # Trim leading blanks...
$data =~ s/\s+$//g; # Trim trailing blanks...
$data =~ s/\Q$db_delim\E/~~/og; # Change delimeter to ~~ symbol.
$data =~ s/\n/``/g; # Change newline to `` symbol.
$data =~ s/\r//g; # Remove Windows linefeed character.
}
$code = &my_subroutine();
print ARC "$code|$data[1]|$data[3]\n";
Julian
Subject Author Views Date
Thread Question about archive vampy 1886 Feb 2, 2002, 9:09 PM
Thread Re: [vampy] Question about archive
kellner 1803 Feb 3, 2002, 1:09 PM
Thread Re: [kellner] Question about archive
Paul 1803 Feb 3, 2002, 1:49 PM
Thread Re: [RedRum] Question about archive
vampy 1798 Feb 5, 2002, 4:56 AM
Post Re: [vampy] Question about archive
kellner 1771 Feb 5, 2002, 5:08 PM