#!/usr/bin/perl -w BEGIN {undef $/;} # I TRIED 1ST my $match = "^module.*?$ARGV[2].*?([\\(;])"; 2ND my $match = "\^module.*?$ARGV[2].*?([\\(;])"; 3RD my $match = "\\^module.*?$ARGV[2].*?([\\(;])" my $match = "module.*?$ARGV[2].*?([\\(;])"; #print "$match"; my $filename = $ARGV[0]; open (INFILE, "<", $filename) or die "Failed to read file $filename : $! \n"; $string = ; close INFILE; #I ALSO TRIED "$string =~ s/^$match/module $ARGV[1]$1/sg;"; $string =~ s/$match/module $ARGV[1]$1/sg; open OUTFILE, ">$ARGV[0]" || die "Failed to create $ARGV[0]\n"; print OUTFILE ($string); close OUTFILE; #### //Verilog HDL for "tt", "hh" "functional" // if i write the word here the script goofs up `timescale 1ps/10fs module OLD(Y, A, B ); output Y; input A; input B; endmodule #### //Verilog HDL for "tt", "hh" "functional" // if i write the word here the script goofs up `timescale 1ps/10fs module NEW(Y, A, B ); output Y; input A; input B; endmodule #### //Verilog HDL for "tt", "hh" "functional" // if i write the word module here the script goofs up `timescale 1ps/10fs module OLD(Y, A, B ); output Y; input A; input B; endmodule #### //Verilog HDL for "tt", "hh" "functional" // if i write the word module NEW(Y, A, B ); output Y; input A; input B; endmodule