I'm resending this in plain text format in case your HTML email client
stripped out all the line breaks like mine did.  :-(

On 6/30/09 2:43 PM, "Michael Boudreau" <mboud...@ad.uchicago.edu> wrote:

> Hi all,
> 
> I'm stumped by a Mason component that was working fine and suddenly is broken
> in a way I can't see.
> 
> I'm building a small Mason app on Mac OS X 10.5.7 with Mason 1.4, Apache 2.2,
> mod_perl 2.0.2, and Perl 5.8.8.
> 
> Today I began moving subroutines out of the individual Mason pages and into a
> module. All was working fine--the Mason pages were finding the subroutines
> they needed--and then it stopped.
> 
> Here's the beginning of my module:
 
  package UCP::Sfmail;
  use strict;
  our (@ISA, @EXPORT, $VERSION);
  use Exporter; 
  $VERSION = 1.00;
  @ISA = qw(Exporter);
  @EXPORT = qw( get_categories get_users );

  sub get_categories {
     my %categories;
     [snip]
     return %categories;
  }
  ... 

> And here's the beginning of the Mason page:

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
  <html xmlns="http://www.w3.org/1999/xhtml";>
  <%init>
  use DBI;
  use UCP::Sfmail;

  # database credentials
  my $dbsrc = "DBI:mysql:mydb:localhost";
  my $user  = "myuser";
  my $pass  = "mypass";
  my %attr  = ( RaiseError => 0, PrintError => 0 );

  our $dbh = DBI->connect($dbsrc, $user, $pass, \%attr)
     or die "Cannot connect: $DBI::errstr";

  # fatal errors or non-fatal warnings are displayed
  # before any page content
  our @fatal_errors;
  our @warnings;

  # for drop-down menus and other display
  my %categories = get_categories();
  my %users = get_users();

> Now when I load this page, I get this error message:
> 
>> Undefined subroutine &HTML::Mason::Commands::get_categories called at
>> /Users/mrb/Sites/mason/sfmail_new/sfmail_new_inbox.html line 22.
> 
> I'm confused because the 'use UCP::Sfmail' command is not giving me an error
> (though it does when I change the module name to something non-existent). This
> really was working just a few hours ago. I can't think what I could have done
> to break it, and the error message seems to defy the evidence of the Sfmail.pm
> file itself. I've tried restarting Apache, as well as the Mac itself, and no
> luck.
> 
> Where should I be looking? What have I missed?

-- 
Michael R. Boudreau
Senior Publishing Technology Analyst
The University of Chicago Press
1427 E. 60th Street
Chicago, IL 60637
(773) 753-3298    fax: (773) 753-3383



------------------------------------------------------------------------------
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to