Gossamer Forum
Home : Products : Links 2.0 : Customization :

Last link problem please help :(

Quote Reply
Last link problem please help :(
I am having a last link problem and cannot figure out what might be the problem. Below is the code I am using

my $LASTX = 5;
open (DB, "<$db_file_name") or &cgierr("unable to open database:$db_file_name.\nReason: $!");
my @lines = <DB>;
close DB;
for ($i=$#lines; $i>=$#lines - $LASTX; $i--) {
chomp $lines[$i];
@tmp = &split_decode ($lines[$i]);
%tmp = &array_to_hash (0, @tmp);
$lastlink .= &site_html_link (%tmp);
}

And the result:

Message : fatal error: Modification of non-creatable array value attempted, subscript -2 at nph-build.cgi line 963.


Any help very much appreciated,

Thank you,

Lpluby
Quote Reply
Re: Last link problem please help :( In reply to
Hello,

From the code you gave, you are trying to list the last five links added. If you have less than 5 links in your database then you'll get the error you received.

Frank

------------------
Webmasters Resources
http://www.webmasters-resources.com/
Quote Reply
Re: Last link problem please help :( In reply to
Thank you Smile