use WWW::Mechanize;
sub new {
- my ( $class ) = @_;
+ my ( $class, $database ) = @_;
my $self = {
mech => WWW::Mechanize->new(),
+ database => $database,
};
bless $self, $class;
return $self;
sub save_marc {
my ( $self, $id, $marc ) = @_;
- my $database = ref $self;
+ my $database = $self->{database};
mkdir 'marc' unless -e 'marc';
mkdir "marc/$database" unless -e "marc/$database";
return;
}
- my $from = $module->new;
+ my $from = $module->new( $database );
diag "using $module for $database ", Dumper( $from );