There is no need for a loop when only grab the first line of a file which only has one line. Also remove the newline from the grabbed line, which may cause malfunctions on further processing.
Signed-off-by: Stefan Schantl <[email protected]> --- config/cfgroot/general-functions.pl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl index 1c3374d86..bcc8942c3 100644 --- a/config/cfgroot/general-functions.pl +++ b/config/cfgroot/general-functions.pl @@ -1058,11 +1058,9 @@ sub GetCoreUpdateVersion() { my $core_update; open(FILE, "/opt/pakfire/db/core/mine"); - while (<FILE>) { - $core_update = $_; - last; - } + $core_update = <FILE>; close(FILE); + chomp($core_update); return $core_update; } -- 2.47.3
