summaryrefslogtreecommitdiffstats
path: root/Discover.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2006-02-27 14:58:12 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2006-02-27 14:58:12 +0000
commit58739218a070ff6668beecf2b3b5e7173a663de9 (patch)
tree960922f4b6bb0031a84b3d6e5024bb51cbcc4628 /Discover.pm
parent264b57ab763d9bbc6ae83c5ead1c4d9948de07f5 (diff)
downloadmgaonline-58739218a070ff6668beecf2b3b5e7173a663de9.tar
mgaonline-58739218a070ff6668beecf2b3b5e7173a663de9.tar.gz
mgaonline-58739218a070ff6668beecf2b3b5e7173a663de9.tar.bz2
mgaonline-58739218a070ff6668beecf2b3b5e7173a663de9.tar.xz
mgaonline-58739218a070ff6668beecf2b3b5e7173a663de9.zip
perl_checker fixes
Diffstat (limited to 'Discover.pm')
-rw-r--r--Discover.pm21
1 files changed, 9 insertions, 12 deletions
diff --git a/Discover.pm b/Discover.pm
index 8b0e220c..e2dff77d 100644
--- a/Discover.pm
+++ b/Discover.pm
@@ -38,8 +38,7 @@ use Log::Agent; # use settings from main file
my $VERSION = '0.01';
#
-sub new
-{
+sub new {
my $self = {};
bless $self, "Discover";
logsay "DNS Service Discovery module $VERSION";
@@ -47,15 +46,14 @@ sub new
}
#
-sub init
-{
+sub init {
my $this = shift;
$this->{domainname} = '';
$this->{zone} = '';
$this->{service} = '';
$this->{nameserver} = '';
$this->{instance} = '';
-};
+}
#
sub commify_series {
@@ -63,7 +61,7 @@ sub commify_series {
(@_ == 1) ? $_[0] :
(@_ == 2) ? join(" and ", @_) :
join(", ", @_[0 .. ($#_-1)], "and $_[-1]");
-};
+}
#
sub search {
@@ -73,13 +71,12 @@ sub search {
my $resolv = Config::Auto::parse('/etc/resolv.conf');
my $servicetype = '_mdvonline._http._tcp.bonjour.';
- my @domains = ();
- my @services = ();
+ my (@domains, @services);
! defined $resolv and logerr "No config found from /etc/resolv.conf.", return 0;
defined $resolv->{domain} and @domains = $resolv->{domain};
- defined $resolv->{search} and push( @domains, @{$resolv->{search}} );
+ defined $resolv->{search} and push @domains, @{$resolv->{search}};
@domains = uniq(@domains);
for my $domain ( @domains ) {
@@ -196,12 +193,12 @@ sub parse_txt_config {
my ($this, @config) = @_;
my $retconfig;
- foreach my $line ( @config ) {
+ foreach my $line (@config) {
# TODO match these with a regexp
my @line = split('=', $line);
my $key = shift(@line);
my $value = join('=', @line);
- switch( $key ) {
+ switch ($key) {
case 'txtvers' { $retconfig->{txtvers} = $value; }
case 'conf' {
my @co = split(',', $value);
@@ -220,4 +217,4 @@ sub parse_txt_config {
return $retconfig;
};
-1; \ No newline at end of file
+1;