From 1fd526a571ef2ecb638bfb3b620e5b13f07c4504 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Sat, 24 Jan 2009 16:59:31 +1100 Subject: Vyatta::Misc - Fix perl critic warnings Eliminate warnings about 2 arg open, and non stricture. --- lib/Vyatta/Misc.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/Vyatta/Misc.pm b/lib/Vyatta/Misc.pm index 3c89871..83cc36e 100755 --- a/lib/Vyatta/Misc.pm +++ b/lib/Vyatta/Misc.pm @@ -22,15 +22,14 @@ # **** End License **** package Vyatta::Misc; +use strict; + require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(get_sysfs_value getInterfaces getNetAddIP isIpAddress is_ip_v4_or_v6 is_dhcp_enabled is_address_enabled); -@EXPORT_OK = qw(get_sysfs_value getNetAddIP isIpAddress is_ip_v4_or_v6 +our @ISA = qw(Exporter); +our @EXPORT = qw(get_sysfs_value getInterfaces getNetAddIP isIpAddress is_ip_v4_or_v6 is_dhcp_enabled is_address_enabled); +our @EXPORT_OK = qw(get_sysfs_value getNetAddIP isIpAddress is_ip_v4_or_v6 getInterfacesIPadresses getPortRuleString); - -use strict; - use Vyatta::Config; use Vyatta::Interface; use NetAddr::IP; @@ -103,7 +102,8 @@ sub getIP { my ($name, $type) = @_; my @addresses; - open my $ipcmd, "ip addr show dev $name |" + open my $ipcmd, '-|' + or exec qw(ip addr show dev), $name or die "ip addr command failed: $!"; <$ipcmd>; -- cgit v1.2.3