From f962f7682891fb2093fe3f1d3de966fff1a16b9d Mon Sep 17 00:00:00 2001 From: teastep Date: Sat, 31 Mar 2007 00:27:36 +0000 Subject: [PATCH] Some code simplification git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5768 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- New/Shorewall/Common.pm | 16 ++++++++-------- New/Shorewall/Config.pm | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/New/Shorewall/Common.pm b/New/Shorewall/Common.pm index c91f80075..d82a01be1 100644 --- a/New/Shorewall/Common.pm +++ b/New/Shorewall/Common.pm @@ -221,9 +221,9 @@ sub copy( $ ) { open IF , $file or fatal_error "Unable to open $file: $!"; - while ( my $line = ) { - $line =~ s/^/$indent/ if $indent; - print $object $line; + while ( ) { + s/^/$indent/ if $indent; + print $object $_; } close IF; @@ -238,16 +238,16 @@ sub copy1( $ ) { my $do_indent = 1; - while ( my $line = ) { - if ( $line =~ /^\s+$/ ) { + while ( ) { + if ( /^\s+$/ ) { print $object "\n"; $do_indent = 1; next; } - $line =~ s/^/$indent/ if $indent && $do_indent; - print $object $line; - $do_indent = ! ( $line =~ /\\$/ ); + s/^/$indent/ if $indent && $do_indent; + print $object $_; + $do_indent = ! ( /\\$/ ); } close IF; diff --git a/New/Shorewall/Config.pm b/New/Shorewall/Config.pm index ad6b1d8a1..860282429 100644 --- a/New/Shorewall/Config.pm +++ b/New/Shorewall/Config.pm @@ -399,7 +399,7 @@ sub read_a_line { open $currentfile, $filename or fatal_error "Unable to open $filename: $!"; $currentfilename = $filename; $currentlinenumber = 0; - $line=''; + $line = ''; } else { return 1; }