Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi Corion..

The code is working fine, but not does my intention function...i modified the code for my need based on your comments as followed...

use strict; use warnings; open (IN1, "<design_modify1.vhd") or die; open (OUT, ">output_file.vhd") or die; open (IN2, "<nets.txt") or die; open (IN3, "<enabled_nets.txt") or die; my @nets = <IN2>; my @enabled_nets = <IN3>; chomp @nets; chomp @enabled_nets; while (<IN1>) { print OUT; foreach my $i (0..$#nets){ print OUT if (s/\=\>\s+$nets[$i]\,/\=\> $enabled_nets[$i]\,/); #} } close (IN1); close (OUT); close (IN2); close (IN3);

I want the output file as follows.. (shown only the modifiable lines)

VCC_i : VCC port map(Y => \VCC\); sum_1_SUM0_0 : XOR3 port map(A => b_e, B => a_e, C => c_e, Y => su +m_c); carry_pad : OUTBUF port map(D => N_5, PAD => carry); a_pad : INBUF port map(PAD => a, Y => a_c);

but it is printing as follows.. I understood the mistake in the code that since i wrote the print statement inside for loop, it gets only one element of array at a time.. So, do you have any suggestions for this???

VCC_i : VCC port map(Y => \VCC\); sum_1_SUM0_0 : XOR3 port map(A => b_c, B => a_c, C => c_c, Y => su +m_c); sum_1_SUM0_0 : XOR3 port map(A => b_c, B => a_e, C => c_c, Y => su +m_c); sum_1_SUM0_0 : XOR3 port map(A => b_e, B => a_e, C => c_c, Y => su +m_c); sum_1_SUM0_0 : XOR3 port map(A => b_e, B => a_e, C => c_e, Y => su +m_c); carry_pad : OUTBUF port map(D => N_5, PAD => carry); a_pad : INBUF port map(PAD => a, Y => a_c);

In reply to Re^3: regex statement to call variable value is not working?? by sumathigokul
in thread regex statement to call variable value is not working?? by sumathigokul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found