use Cwd;
use strict;
use warnings;
no warnings 'numeric';
chdir("/root/dev/git_repo");
qx{git checkout master};
my $pull = qx{git pull};
if ($pull != "Already up-to-date."){
my @output = $pull;
chomp @output;
foreach my $line (@output)
{
print "<<$line>>\n";
}
}
if ($pull == "Already up-to-date.") everything is fine, but
if ($pull != "Already up-to-date."){
then I won't be able to enter the loop, I'm not being able to convert the output to an array correctly. I tried other things like split /^/m, $pull.
I need to be able to parse it in order to get the files I need. I don't want to use any external libraries, because I have to use this script on old servers that are not connected to the internet.