#!/usr/bin/perl -w $|++; use CGI qw/:standard/; do "functions/func.pl"; print header(-type=>'application/rss+xml'); print ' Blog de tfe : tfeserver RSS http://tfeserver.homelinux.com '; &connect_db(); my $sth = $dbh->prepare("SELECT * FROM news ORDER BY id DESC LIMIT 10"); $sth->execute(); $dbh->prepare("none"); # pour pas que warning :p print " "; while (my $hash_ref = $sth->fetchrow_hashref) { print " "; } print " "; $sth = $dbh->prepare("SELECT * FROM news ORDER BY id DESC LIMIT 10"); $sth->execute(); $dbh->prepare("none"); # pour pas que warning :p while (my $hash_ref = $sth->fetchrow_hashref) { $date = ${$hash_ref}{'date'}; $date =~ s/(\d{4})\-(\d{2})\-(\d{2}).*/$1-$2-$3/; ${$hash_ref}{'contenu'} =~ s/\[\/?code\]//g; print " <![CDATA[". ${$hash_ref}{'nom'}."]]> tfe $date http://tfeserver.homelinux.com/site/news/". ${$hash_ref}{'id'}." "; } print "\n\n";