#!/tool/pandora64/bin/perl5.8.8 -w use strict; use warnings; my @verilogfiles = glob '*.verilog'; my ($vf, $of, $i, $j); print "Define the path for sdf_annotate.v: "; my $path = ; chomp($path); #For verilog files foreach my $b (@verilogfiles) { open $vf, '>>', $b or die "Could not open file '@verilogfiles' $!"; if($_ =~ /module entity\;/) { print $vf "\`include \"$path\"\n"; } } close ($vf);