From 258a2a800e78658bee79897439505bd97546e70c Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Mon, 27 May 2013 11:07:27 +0200 Subject: [PATCH] fix some perl warnings --- mxmount | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/mxmount b/mxmount index 7409276..8c7ded2 100755 --- a/mxmount +++ b/mxmount @@ -4,18 +4,23 @@ use Sys::Hostname; use Data::Dumper; use Socket; +use warnings; + ######################################## -my $configfile="/etc/mxmounts"; -my $exports="/etc/exports"; +my $configfile = "/etc/mxmounts"; +my $exports = "/etc/exports"; ######################################## my $tag = "# DO NOT EDIT BELOW THIS LINE # created by /usr/bin/mxmount #"; -my $fullhostname, $hostname; -my @lines,@exports; -my %V, %D; +my $fullhostname; +my $hostname; +my @lines; +my @exports; +my %V; +my %D; $fullhostname = hostname(); ($hostname) = $fullhostname =~ /^(.*?)\./; @@ -100,7 +105,7 @@ sub create_exports { sub mount_all { my $allmp = $D{$hostname}; my @CMD; - foreach my $mp (sort { $a->{mountpoint} <=> $b->{mountpoint} } @$allmp) { + foreach my $mp (sort { $a->{mountpoint} cmp $b->{mountpoint} } @$allmp) { @CMD = (); @@ -202,7 +207,7 @@ sub parse_variables { my @lines = @_; my @invalid = (); - my $key, $value; + my ($key, $value); foreach(@lines) { if(($key, $value) = /^(\S+)=\s*(.*)$/) {