opendir( my $synthdir,$target_dirsynth1) or die "Couldn't enter config directory: $!\n"; print("\nSYNTHESIS INPUT FILES IN CURRENT DIRECTORY \n"); my $synthfilelist = glob "*.qsf"; print ("\n$synthfilelist \n"); my $originalquartus ; my $latestquartus ; my $readlineqo; my $readlineql ; open (my $OFILE,$synthfilelist) || die "couldnt open file: $!"; while ($readlineqo = <$OFILE>) { chomp $readlineqo; if ($readlineqo =~ /ORIGINAL_QUARTUS_VERSION/) { my @originalqarray = (split / +/ , $readlineqo); $originalquartus = $originalqarray[3]; print "\nthe original quartus $originalquartus\n"; } next if $readlineqo =~ /^ $/; } close($OFILE); open (my $LFILE,$synthfilelist) || die "couldnt open file: $!"; while ($readlineql = <$LFILE>) { chomp $readlineql; print "into the second loop $readlineql\n"; if ($readlineql =~ /LAST_QUARTUS_VERSION/) { my @latestqarray = (split / +/ , $readlineql); $latestquartus = $latestqarray[3]; print "\nthe latest quartus $latestquartus\n"; } next if $readlineql =~ /^ $/; } close($LFILE);