Craig,
I dunno. TheByrdMan never said what the "ugly" error messages were that he was getting so I just left it alone since he had a fix that seemed to work for him. The only thing I see in my code that might need changing is to use $rec{'ID'} instead of $rec[0]. Other than that, it should work.
His code doesn't even check to make sure a valid ID was even in the database to begin with, so the call to sub error in $goto or &error will never occur, even if there was no such ID.
Actually, I did find another error in my code. I forgot to include a "}" to end the "if" statement. The corrected code should be this:
open (URL, "<$db_links_name") or
&error ("unable to open database: $db_links_name. Reason: $!");
while (<URL> ) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@rec = &split_decode($_);
if ($id eq $rec{'ID'}) {
$goto = "$build_detail_url/$rec{'ID'}$build_extension";
last;
}
}
close URL;
$goto or &error ("Can't find link id: $id");
I hope this helps.
[This message has been edited by Bobsie (edited May 29, 1999).]
I dunno. TheByrdMan never said what the "ugly" error messages were that he was getting so I just left it alone since he had a fix that seemed to work for him. The only thing I see in my code that might need changing is to use $rec{'ID'} instead of $rec[0]. Other than that, it should work.
His code doesn't even check to make sure a valid ID was even in the database to begin with, so the call to sub error in $goto or &error will never occur, even if there was no such ID.
Actually, I did find another error in my code. I forgot to include a "}" to end the "if" statement. The corrected code should be this:
Code:
# Let's get the URL. open (URL, "<$db_links_name") or
&error ("unable to open database: $db_links_name. Reason: $!");
while (<URL> ) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@rec = &split_decode($_);
if ($id eq $rec{'ID'}) {
$goto = "$build_detail_url/$rec{'ID'}$build_extension";
last;
}
}
close URL;
$goto or &error ("Can't find link id: $id");
I hope this helps.
[This message has been edited by Bobsie (edited May 29, 1999).]