#! /usr/bin/perl -w use strict; use CGI; # cgi my $q = CGI->new(); # file descriptions my $isnotfile = "_isnot/isnot.xml"; my $isnottemplate = "_isnot/isnot.tmpl"; # general vars my $news_template_file; my $page_template_file; ################################################################### # Main ################################################################### print $q->header; print displaypage(getdata($isnotfile), $isnottemplate); # end. ################################################################### # Subs ################################################################### sub getdata { my ($file) = shift; my $isnotdata = []; open (DATA, "< $file") || die_nice('swink is not, well.. is not working, call back later'); while (my $line = ){ if ($line =~ m/(.*?)<\/isnot>/i){ my $isnot = {}; my $attributes = $1; $isnot->{text} = $2; warn "text: ".$isnot->{text}."#end\n\n"; if ($attributes =~ m/date="(.*?)"/i){ $isnot->{date} = $1; } if ($attributes =~ m/user="(.*?)"/i){ $isnot->{user} = $1; } if ($attributes =~ m/email="(.*?)"/i){ $isnot->{email} = $1; } push (@$isnotdata, $isnot); } } close DATA; return $isnotdata; } ################################################################### sub displaypage { my ($isnotdata, $template_file) = @_; my $template; open (TEMPLATE, "< $template_file") || die_nice('swink is not, well.. is not working, call back later'); while (