table of contents
RoPkg::Rsync::Atom(3pm) | User Contributed Perl Documentation | RoPkg::Rsync::Atom(3pm) |
NAME¶
RoPkg::Rsync::Atom - the smallest unit in a rsync configuration fileSYPONSIS¶
#!/usr/bin/perl
use strict; use warnings;
use RoPkg::Rsync::Atom;
sub main { my $a = new RoPkg::Rsync::Atom( type => 'param', name => 'uid', value => 'nobody', );
print $a->ToString(0),$/;
return 0; }
main();
DESCRIPTION¶
RoPkg::Rsync::Atom is a class used by RoPkg::Rsync modules. The Atom is considered the smallest part of any rsync configuration file. An atom can be (at this moment):- param
- blank
- comment
METHODS¶
All methods, throw the OutsideClass exception, if you use them as class methods. Example:perl -MRoPkg::Rsync::Atom -e 'RoPkg::Rsync::Atom->Type;' Called outside class instanceBesides OutsideClass the methods are throwing other exceptions as well. Refer to each method documentation for more information.
- *) type - type of the atom
- *) name - name of the atom
- *) value - value of the atom
- *) param - a parameter in the standard form (name = value)
- *) comment - a comment
- *) blank - a blank line (or only with separators)
my $a = new RoPkg::Rsync::Atom( type => 'param', name => 'gid', value => 'users', );example 2 (param):
my $a = new RoPkg::Rsync::Atom(type => 'param'); $a->Name('gid'); $a->Value('users'); print 'Name of the atom is:',$a->Name,$/;example 3 (comment):
my $a = new RoPkg::Rsync::Atom( type => 'comment', value => '# this is the group id', );example 4 (blank):
my $a = new RoPkg::Rsync::Atom( type => 'blank', value => q{ }, );
my $a = new RoPkg::Rsync::Atom( type => 'param', name => 'gid', value => 'users', );
print $a->ToString(0, 6),$/, $a->ToString(0, 5),$/, $a->ToString(0, 4),$/, $a->ToString(0, 3),$/, $a->ToString(1, 6),$/, $a->ToString(1, 5),$/, $a->ToString(1, 4),$/, $a->ToString(1, 3),$/;The result is:
gid = users
gid = users
gid = users
gid = users
gid = users
gid = users
gid = users
gid = users
PREREQUISITES¶
perl 5.008 (or later) is required. Besides perl, you must have the following:- RoPkg::Exceptions
- English
- Scalar::Util
SEE ALSO¶
RoPkg::Rsync::Node RoPkg::Rsync::ConfFile RoPkg::ExceptionsAUTHOR¶
Subredu Manuel <diablo@iasi.roedu.net>LICENSE¶
Copyright (C) 2005 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.2006-06-09 | perl v5.8.8 |