Hello, this is my first post. I try to sort the links in my newsletter, but i canīt! I want to sort by date, firts the new one... somebody can help me?
Thanks a lot!
this is the code on my db_utils.pl
sub build_new_links {
# --------------------------------------------------------
# Returns a text string used in the email newsletter of all
# new links.
#
my $output = '';
my (@data, %rec);
open (DB, "<$db_file_name") or &cgierr("unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
chomp;
@data = &split_decode($_);
if ($data[$db_isnew] eq 'm5m') {
%rec = &array_to_hash(0, @data);
my $des_q = &linewrap ($rec{'Pie'});
$output .= qq~
---------------------------------------------------------
$rec{'Title'}
$rec{'URL'}
$des_q
~;
}
}
close DB;
return $output;
}
Thanks a lot!
this is the code on my db_utils.pl
sub build_new_links {
# --------------------------------------------------------
# Returns a text string used in the email newsletter of all
# new links.
#
my $output = '';
my (@data, %rec);
open (DB, "<$db_file_name") or &cgierr("unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
chomp;
@data = &split_decode($_);
if ($data[$db_isnew] eq 'm5m') {
%rec = &array_to_hash(0, @data);
my $des_q = &linewrap ($rec{'Pie'});
$output .= qq~
---------------------------------------------------------
$rec{'Title'}
$rec{'URL'}
$des_q
~;
}
}
close DB;
return $output;
}