From d42e3eb31ae72c4713d6cbdbea4d2d5fc9de561c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 17 Oct 2012 16:54:44 +0000 Subject: (get_dir) do not reinvent cat_or_die() --- ftp_wizard/Proftpd.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ftp_wizard/Proftpd.pm b/ftp_wizard/Proftpd.pm index ad642b63..2c2fd2fd 100755 --- a/ftp_wizard/Proftpd.pm +++ b/ftp_wizard/Proftpd.pm @@ -196,10 +196,7 @@ sub true { sub get_dir { die "no FTP configuration file found! warning." if !-f $file; - local *NEW; - open(NEW, "< $file") or die "error while opening $file: $!"; - local $_; - while () { # we need 3 elements to consider section as known + foreach (cat_or_die($file)) { # we need 3 elements to consider section as known if (m/^\s*/s...m!^\s*!s) { if (m/^\s*/s) { return $1; -- cgit v1.2.1