Hello people,
Im pretty new to perl, just learning right now. I'm looking to replace some cells in a verilog file using the verilog-perl module.
My question is this:
The verilog perl module has a function called "->dump_drivers". So basically when I do:
$netdrivers = ($pin->net)->dump_drivers;
The output I see on the screen is:
Net:in2
Port: in2 in
Pin: U1.IN2 in
Pin: U2.IN2 in
What I am trying to so is this :
$netdrivers = ($pin->net)->dump_drivers;
my @netdrivers_split = split(/\n/,$netdrivers);
foreach my $val (@netdrivers_split) {
#some code
}
What I want it to do is save
Net:in2
Port: in2 in
Pin: U1.IN2 in
Pin: U2.IN2 in
Then split it into an array using the newline delimiter so I can use the individual values. But when I do
$netdrivers = ($pin->net)->dump_drivers;
my @netdrivers_split = split(/\n/,$netdrivers);
print @netdrivers_split;
I get:
Net:in2
Port: in2 in
Pin: U1.IN2 in
Pin: U2.IN2 in
0 but true
Why is the value in "@netdrivers_split" "0 but true"? Is this the right way to do it?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.