It didn't help... thanks for the try, though, JimB

HTML:

<div id="content">

<h3><& SELF:title &></h3>

<table>
% foreach $date (sort keys %{$rep->{res}}) {
<tr>
%   foreach $item (@{$rep->{res}->{$date}})
%   {
    <td> <% $item %> </td>
%   }
</tr>
% }

</table>
</div>

<%method title>
Network Engineering and Operations Home
</%method>

<%once>
use Reports::WSB
</%once>

<%init>
my $item = 0;
my $date = 0;
my $rep = WSB->new($RepDBH, "2006", "March", "03");
$rep->exec();
</%init>

ERROR:

System error

error:  Error during compilation of /usr/local/www/docs/index.html:
Global symbol "%_method" requires explicit package name at 
/usr/local/www/docs/index.html line 30.

 
context:  ...   
26:  <%init> 
27:  my $item = 0; 
28:  my $date = 0; 
29:  my $rep = WSB->new($RepDBH, "2006", "March", "03"); 
30:  $rep->exec(); 
31:  </%init> 
32:   
 
code stack:  /usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/Interp.pm:445
/usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/Request.pm:238
/usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/Request.pm:204
/usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/ApacheHandler.pm:97
/usr/local/lib/perl5/site_perl/5.8.7/Class/Container.pm:275
/usr/local/lib/perl5/site_perl/5.8.7/Class/Container.pm:353
/usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/Interp.pm:348
/usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/ApacheHandler.pm:869
/usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/ApacheHandler.pm:823
(eval 33):8
-e:0
 

> ----- Original Message -----
> From: "Vimal Jani" <[EMAIL PROTECTED]>
> To: "Jim Babcock" <[EMAIL PROTECTED]>, [email protected]
> Subject: RE: [Mason] %_method error
> Date: Thu, 23 Mar 2006 17:51:14 -0500
> 
> 
> Mason expects "%" as first character in line. Try correcting it in your
> HTML page.
> 
> Regards,
> 
> Vimal
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Jim
> Babcock
> Sent: Thursday, March 23, 2006 5:45 PM
> To: [email protected]
> Subject: [Mason] %_method error
> 
> I'm getting an error that I think is the compiler getting confused on an
> earilier mistake, but I can't see it.
> 
> I've built a package called Reports::WSB that builds an mysql query with
> the dbh and other parameters passed in the new method. The exec method
> prepares and executes the query, puts the results in a HOA on the object
> and finishes the statement. I developed the code and tested it with a
> command line Perl script, so I'm pretty confident in it. The code in the
> html page is a derivation of that script.
> 
> Here is the HTML:
> 
> <div id="content">
> 
> <h3><& SELF:title &></h3>
> 
> <table>
> % foreach $date (sort keys %{$rep->{res}}) {
> <tr>
>    % foreach $item (@{$rep->{res}->{$date}})
>    % {
>      <td> <% $item %> </td>
>    % }
> </tr>
> % }
> 
> </table>
> </div>
> 
> <%method title>
> Network Engineering and Operations Home
> </%method>
> 
> <%once>
> use Reports::WSB
> </%once>
> 
> <%init>
> my $item;
> my $date;
> my $rep = WSB->new($RepDBH, "2006", "March", "03");
> $rep->exec();
> </%init>
> 
> Here is the ERROR:
> 
> error:  Error during compilation of /usr/local/www/docs/index.html:
> Global symbol "%_method" requires explicit package name at
> /usr/local/www/docs/index.html line 30.
> 
> 
> context:  ...
> 26:  <%init>
> 27:  my $item;
> 28:  my $date;
> 29:  my $rep = WSB->new($RepDBH, "2006", "March", "03");
> 30:  $rep->exec();
> 31:  </%init>
> 32:
> 
> code stack:
> /usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/Interp.pm:445
> /usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/Request.pm:238
> /usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/Request.pm:204
> /usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/ApacheHandler.pm:97
> /usr/local/lib/perl5/site_perl/5.8.7/Class/Container.pm:275
> /usr/local/lib/perl5/site_perl/5.8.7/Class/Container.pm:353
> /usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/Interp.pm:348
> /usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/ApacheHandler.pm:869
> /usr/local/lib/perl5/site_perl/5.8.7/HTML/Mason/ApacheHandler.pm:823
> (eval 33):8
> -e:0
> 
> Here is the PACKAGE:
> 
> #!/usr/bin/perl -I/usr/local/www/lib/
> 
> use strict;
> use Reports::WSB;
>    use lib qw(/usr/local/www/lib/);
>    use DBI;
> #! /usr/local/perl
> package WSB;
> use strict;
> 
> sub new
> {
>    my $rep = ();
>    shift;
>    $rep->{dbh} = shift;
>    $rep->{year} = shift;
>    $rep->{month} = shift;
>    $rep->{day} = shift;
>    $rep->{qstr} = "";
>    $rep->{res} = ();
>    bless($rep);
>    my $where = "";
>    my $seg1 = "select date_format(tstamp,\'";
>    my $seg2 = "%Y%m";
>    my $seg3 = "\') d,date_format(tstamp,\'";
>    my $seg4 = "%M %Y";
>    my $seg5 = "') num, round(avg(average),1),max(maximum),sum(op100),
> sum(op700),sum(total) from coal_counts ";
>    my $seg6 = " group by num order by d desc";
> 
>    if (defined $rep->{month})
>    {
>     $seg2 = "%Y%m%d";
>      $seg4 = "%d %b";
>      $where = " where date_format(tstamp, \'%M %Y\') = \'$rep->{month}
> $rep->{year}\' ";
>    }
> 
>    if (defined $rep->{day})
>    {
>      $seg2 = "%Y%m%d%H";
>      $seg4 = "%l%p";
>      $where = " where date_format(tstamp, \'%Y%M%d\') =
> \'$rep->{year}$rep->{month}$rep->{day}\' ";
>    }
> 
>    $rep->{qstr} = $seg1 . $seg2 . $seg3 . $seg4 . $seg5 . $where . $seg6;
>    bless($rep);
>    return($rep);
> }
> 
> sub exec
> {
>    my $self = shift;
> 
> print "$self->{qstr}\n";
>    my $q_stmt = $self->{dbh}->prepare($self->{qstr});
>    $q_stmt->execute();
> 
>    while (my @data = $q_stmt->fetchrow_array())
>    {
>      $self->{res}->{$data[0]} = [EMAIL PROTECTED];
>    }
> 
>    $q_stmt->finish();
> 
>    return;
> }
> 
> 1;
> 
> Thanks for your help!
> 
> JimB
> 
> --
> ___________________________________________________
> Play 100s of games for FREE! http://games.mail.com/
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Mason-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mason-users

>


-- 
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to