[Dbix-class] DBIc-Class-ResultSet
Kjell Arne Arvesen
kjell.arvesen at siegedesign.no
Sat Apr 8 11:37:20 CEST 2006
Hiya.
I've created an instance of DBIx::Class::ResultSet for a table class
called user where I have the following method:
Example:
sub update_email {
...
my $rs = $self->search({...}); # This returns a proper resultset
my @users = $rs->all; #Returns an array containing all the data for
each users
my $count = 1;
foreach my $user ( @users ) {
print "User name ".$user->name." Email: ".$user->email."\n"; #
Prints the name and the email
my $email = $user->email;
$email =~ s/$count\@userDomain/$count\@userDomain2/gi; # Makes
stopid email adresses :)
$user->email($email) # We now change the default domain name for
all the users
$user->update; # This never happens!
$count++;
}
...
}
The update call never happens and I don't understand why.
Any ideas?
Mvh,
Kjell Arne
More information about the Dbix-class
mailing list