$line =~ s/input .*clk/output .*clk/g;
The first part of s/// is a regular expression but the second part is a string. It is essentially s/REGEX/STRING/. Since (in the first part of your task, which is the only part your code attempts to address) there are no complications, you can ignore the rest of the pattern and just do this:
$line =~ s/input/output/;
That should get you farther along. For the general case you would need to use capture groups.
🦛
In reply to Re: Search and replace
by hippo
in thread Search and replace
by kulua
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |