http://www.perlmonks.org?node_id=985285


in reply to String replace depending on diff

If these are Verilog files, you can use Verilog-Perl to parse the 2 files to get a list of all port names and directions.

Read Writeup Formatting Tips and update your post.