Note, if you comment out the second to the last line $::ht->param(thumb_loop=>[{}]); You no longer get two warnings.#!/usr/bin/perl use strict; use CGI::Carp qw/fatalsToBrowser/; binmode STDIN; use lib 'mods'; require CGI::Lite; require HTML::Template; require DBI; require User; $::dbh=DBI->connect('dbi:mysql:movies','name'); $::ht=new HTML::Template(filename => 'tmpl/default.tmpl'); $::c=new CGI::Lite; $::c->set_directory('uploads'); $::c->set_file_type('file'); %::f=$::c->parse_form_data('GET'); $::f{f}=shift if(~~@ARGV); $::user=new User; my %dispatch= ( news => 'news', add_news => 'add_news', add_news_submit => 'add_news_submit', login => 'login', login_submit => 'login_submit', movie => 'movie', me => 'me', ); if(not $::f{o}) {$::f{o}='news';} warn "_____INDEX.PL______"; #do "subs/$dispatch{$::f{o}}.pl" if($dispatch{$::f{o}}); defaultTmplData(); print "Content-type: text/html\n\n"; print "name: ",$::user->name,' uid: ',$::user->{data}{uid}; print $::ht->output; sub defaultTmplData { my $sql="SELECT mid,tinythumb FROM movies ORDER BY rank DESC limit + 0,5"; my $pn=$::dbh->prepare($sql); $pn->execute; $pn->bind_columns(\my($mid,$thumb)); my @thumbs; while($pn->fetch) { push @thumbs,{thumb_id=>$mid,thumb_url=>$thumb}; } #$::ht->param(thumb_loop=>[@thumbs]); $::ht->param(thumb_loop=>[{}]); }
Help..<html> <head> <style> @import "css/default.css"; <tmpl_loop name='css_import'> @import "css/<tmpl_var name='css_file'>"; </tmpl_loop> </style> <script> </script> </head> <body> <div id='menu'> <br><br><br><br> <br> <h1>Movies</h1> <ul> <li> <a href='?o=movie&p=top10'>Top 10</a> < +/li> <li> <a href='?o=movie&p=browse'>Browse</a> </li +> <li> <a href='?o=movie&p=random1'>Random</a> </l +i> <li> <a href='?o=movie&p=submit'>Submit</a> </li +> <li> <a href='?o=movie&p=search'>Search</a> </li +> </ul> <h1>News</h1> <ul> <li> <a href='?o=news'>News</a> +</li> <li> <a href='?o=add_news'>Add News</a> </li> </ul> <h1>Movie Editing</h1> <ul> <li> <a href='?o=me'>Front Page</a> + </li> <li> <a href='?o=me&p=newest'>Newest Nodes</a> + </li> <li> <a href='?o=me&p=cat&c=question'>Questions</a> + </li> <li> <a href='?o=me&p=cat&c=theory'>Theories</a> + </li> </ul> </div> <div id='title'> <h1>Title!</h1> </div> <div id='main'> <tmpl_var name='main_content'> </div> <div id='thumbs'> <h1>Thumbs</h1> <ul> <tmpl_loop name='thumb_loop'> <li><a href='?o=movie&p=view&id=<tmpl_var name="thumb_ +id">'><img src='<tmpl_var name="thumb_url">'></a></li> </tmpl_loop> </ul> </div> </body> </html>
In reply to HTML::Template, apache, two warnings by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |