kulua has asked for the wisdom of the Perl Monks concerning the following question:
I want to replace below string
input bist_g6bb_prn_clk_bistctlr;
to
output bist_g6bb_prn_clk_bistctlr;
and then change the output bist_g6bb_prn_clk_bistctlr; string to
assign vif.bist_g6bb_prn_clk_bistctlr = bist_g6bb_prn_clk_bistctlr;
use strict; use warnings; use autodie; my $data = <<'EOD'; input bist_g6bb_prn_clk_m; EOD open my $fh, '<', \$data; while (my $line = <$fh>) { $line =~ s/input .*clk/output .*clk/g; print $line; } close $fh;
I am new to perl, Can you point me my mistake ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Search and replace
by hippo (Archbishop) on May 23, 2021 at 13:46 UTC | |
by kulua (Initiate) on May 23, 2021 at 15:39 UTC | |
by hippo (Archbishop) on May 23, 2021 at 16:10 UTC | |
by tybalt89 (Monsignor) on May 23, 2021 at 16:09 UTC | |
|
Re: Search and replace
by 1nickt (Canon) on May 23, 2021 at 13:35 UTC |