AddressBook
view release on metacpan or search on metacpan
lib/AddressBook/DB/DBI.pm view on Meta::CPAN
$entry->{timestamp} = $self->_get_timestamp;
return $entry;
}
return undef;
}
sub _get_timestamp {
my $self = shift;
my $class = ref $self || croak "Not a method call";
if ($self->{dbi_driver} =~ /^CSV/) {
my @stat = stat($self->{dbh}->{f_dir} . "/" . $self->{table});
return ParseDateString("epoch $stat[9]");
} else {
croak "Error: Don't know how to determine timestamp for this database type";
}
}
sub reset {
my $self = shift;
my $class = ref $self || croak "Not a method call";
$self->search;
lib/AddressBook/DB/LDIF.pm view on Meta::CPAN
my %attr = %{$entry->get(db=>$self->{db_name},values_only=>'1')};
($dn_calculate=$self->{dn_calculate}) =~ s/\$(\w*)/\$attr{$1}->[0]/g;
eval qq{\$dn = $dn_calculate}; warn "Syntax error in dn_calculate: $@" if $@;
$dn .= "," . $self->{base};
return $dn;
}
sub _get_timestamp {
my $self = shift;
my $class = ref $self || croak "Not a method call";
my @stat = stat($self->{filename});
return ParseDateString("epoch $stat[9]");
}
1;
=head2 Timestamps
For syncronization purposes, all records are timestamped with the modification date
of the LDIF file.
( run in 2.039 seconds using v1.01-cache-2.11-cpan-49f99fa48dc )