CfgTie
view release on metacpan or search on metacpan
CfgTie2.tex view on Meta::CPAN
@subsubheading Configuration Variables
@cindex Configuration Variables
@subsubheading Additional Routines
@cindex Additional Routines
@table @asis
@item @code{&CfgTie::TieUser'stat()}
@findex @code{&CfgTie::TieUser'stat()}
@item @code{&CfgTie::TieUser_id'stat()}
@findex @code{&CfgTie::TieUser_id'stat()}
Will return @code{stat}-like statistics information on the user database.
@end table
@subsubheading Adding or overiding methods for user records
@cindex Adding or overiding methods for user records
Lets say you wanted to change the default HTML handling to a different method.
bin/mail-validate view on Meta::CPAN
$A =~ s/\\1/$I/g;
print ".$A";
}
}
if ($Verbose & 0x1) {print "\n",$Msgs->{phase3};}
my $GID = $Groups{'mail'}->{id};
foreach $I (@Files)
{
@S = stat($Spool.'/'.$I);
if ($GID != $S[5])
{
#The group owner is wrong.
if ($Verbose & 0x8)
{
my $A = $Msgs->{badgroup};
$A=~s/\\1/$I/g;
print ".$A";
}
if ($Verbose & 0x10)
docs/Overview.tex view on Meta::CPAN
functionality for this.
@subheading Common object methods
There as some standard methods typically (but not always) available to
associative arrays:
@code{HTML();} or @code{$Table->HTML('MyHTMLClass');} This return a
string formatted in HTML. If an HTML class is specified, it will be embedded
in the HTML. This is useful for style sheets.
@code{stat();} This works like a normal @code{stat}, returning information
about the last time the table (e.g. file) was accessed, modified, etc.
@heading Attributes
The flags used in all of the variable control procedures are composed of
three sections, based upon what they control
@table @asis
@item Scope
This controls the scope of the variable setting. The scope, from the
narrowest to the widest scope: @emph{Session}, @emph{Application},
lib/CfgTie/TieRCService.pm view on Meta::CPAN
my $F = new Secure::File "</var/run/$key.pid" or return undef;
my ($I,$pid);
while (<$F>)
{
if (/^(\d+)$/) {$pid=$1;}
}
$F->close;
return $pid;
}
sub _stat($)
{
my $self=shift;
if (!defined $self) {return undef;}
return stat("/var/run/".$self->{'name'}.".pid");
}
sub EXISTS ($$)
{
my ($self,$key)=@_;
my $lkey=lc($key);
if (exists $self->{$lkey}) {return 1;}
if ($lkey eq 'pid')
{
my $pid = proc_id($self->{'name'});
lib/CfgTie/TieRCService.pm view on Meta::CPAN
}
elsif ($lkey eq 'description' || $lkey eq 'defaults')
{
if (!exists $self->{path}) {EXISTS($self,'path');}
if (!exists $self->{path}) {return 0;}
scan_rcscript($self);
return exists $self->{$lkey};
}
elsif ($lkey eq 'stat')
{
my @A= _stat($self);
if (scalar @A) {$self->{'stat'}=[@A]; return 1;}
}
return 0;
}
sub FIRSTKEY
{
EXISTS($_[0],'pid');
my $a = keys %{$_[0]};
return scalar each %{$_[0]};
lib/CfgTie/TieUser.pm view on Meta::CPAN
reflected in the overall system. Additionally, the programmer can set any
other associated key, but this information will only be available to the
running Perl script.
=head2 Configuration Variables
=head2 Additional Routines
=over 1
=item C<&CfgTie::TieUser'stat()>
=item C<&CfgTie::TieUser_id'stat()>
Will return C<stat>-like statistics information on the user database.
=back
=head2 Adding or overiding methods for user records
Lets say you wanted to change the default HTML handling to a different method.
To do this you need only include code like the following:
lib/CfgTie/TieUser.pm view on Meta::CPAN
=head1 Author
Randall Maas (L<randym@acm.org>)
=cut
my $Chg_FS = 1; #By default we want to update the file system when the user
# Id changes
sub stat($)
{
# the information for the /etc/passwd file
stat '/etc/passwd';
}
sub TIEHASH
{
my $self = shift;
my $node = {};
return bless $node, $self;
lib/Secure/File.pm view on Meta::CPAN
}
else
{
r_check($name);
}
}
sub r_check
{
#Check to see if the real user has read privileges
my @S=stat($_[0]);
if (!@S) {return;}
return @S if -R _;
}
sub w_check
{
#Check to see if the real user has write privileges
my @S=stat($_[0]);
if (!@S)
{
if ($_[0] =~ /^(.*)\/[^\/]+$/)
{
@S=stat($1);
return @S if -W _;
}
return;
}
return @S if -W _;
}
sub rw_check
{
#Check to see if the real user has read/write privileges
my @S=stat($_[0]);
if (!@S) {return;}
return undef if !-R _;
return @S if -W _;
}
sub handle_check
{
#Check to be sure that the inode has not changed!
my $Handle = shift;
( run in 0.565 second using v1.01-cache-2.11-cpan-49f99fa48dc )