table of contents
RoPkg::Rsync::Node(3pm) | User Contributed Perl Documentation | RoPkg::Rsync::Node(3pm) |
NAME¶
RoPkg::Rsync::NodeDESCRIPTION¶
A node is a rsync module. A node is formed of zero or more atoms. Example:[debian] path = /var/ftp/pub/mirrors/debian.org/ #This comment will show on rsync -v comment = Debian Mirror list = yes[debian] is the node. The node name is debian. The node has 4 atoms:
- *) param atom (path)
- *) comment atom (the comment)
- *) param atom (comment)
- *) param atom (list)
SYNOPSIS¶
#!/usr/bin/perl
use strict; use warnings;
sub main { my $node = new RoPkg::Rsync::Node(node_name => 'debian');
$node->AddParam('path', '/var/ftp/pub/mirrors/debian.org'); $node->AddComment('#This comment will show on rsync -v'); $node->AddParam('comment', 'Debian Mirror'); $node->AddParam('list', 'yes');
print $node->ToString(); }
main();The result is:
[debian] path = /var/ftp/pub/mirrors/debian.org #This comment will show on rsync -v comment = Debian Mirror list = yes
METHODS¶
All methods, throw the OutsideClass exception, if you use them as class methods. Besides OutsideClass the methods are throwing other exceptions as well. Refer to each method documentation for more information.my $node = new RoPkg::Rsync::Node(node_name => 'debian');
$node->Add( type => 'param', name => 'path', value => '/var/ftp/pub/mirrors/debian.org', );The returned value is the total number of atoms for this node. Example:
$node->Add( type => 'comment', value => '#This comment will show on rsync -v', );The returned value is the name of the atom (the name is autogenerated). Exceptions:
- *) Param::Missing - $atom_details{type} is not defined
- *) Param::Wrong = $atom_details{name} or $atom_details{value} are not defined
-
- *) Param::Missing - type/name were not specified
- *) Param::Unknown - no objects were found
$node = new RoPkg::Rsync::Node(node_name => 'debian'); $node->AddParam('gid', 'users');
print $node->ToString(0, 0),$/, $node->ToString(0, 1),$/, $node->ToString(1, 1),$/, $node->ToString(),$/;The result is:
gid = users
[debian]
gid = users;
[debian]
gid = users
[debian]
gid = users
PREREQUISITES¶
perl 5.008 (or later) is required. Besides perl, you must have the following:- *) RoPkg::Exceptions
- *) Scalar::Util
- *) English
SEE ALSO¶
RoPkg::Rsync::Atom 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 |