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 <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
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;
}