I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-06-30 16:49:05-07 by sirrobert
Moose isn't creating a constructor.
Hey all. I'm experienced with OO perl, but have only built a dozen or so classes with Moose. I'm trying to extend DBI in Moose but ... they don't seem to be friendly with each other =) Can someone please explain what's wrong here? I feel like it's probably something simple that I'm missing. When I "use base" the script runs without error. With "extends" it balks. Here's the error I'm getting:
Can't locate object method "new" via package "DBIX_sample" at ./test.pl line 7.
Here's my source: test.pl
#!/usr/bin/perl use strict; use warnings; use DBIX_sample; my $db = DBIX_sample->new; exit;
DBIX_sample.pm
package DBIX_sample; use Moose; ### Works when I 'use base' but not with 'extends.' extends 'DBI'; #use base 'DBI'; 1;
This is perl, v5.8.8 built for i686-linux
Direct Responses: 11095 | Write a response