in reply to why i cant print reading hash table?
Hello waytoperl,
Here are some of the problems with the code shown:
The following variables are used without being declared:
$infile_CSV, $outfile_CSV, $outfile, $key_CSV
The line
my $count = grep { $_ == {AsyncInNoTimingArc} } values %hash;
uses a numerical comparison against a bareword. Here is a guess at what was intended:
my $count = grep { $_ eq 'AsyncInNoTimingArc' } values %hash;
The C-style for loop begins with the statement $count; which does nothing. Just remove it:
for (; $count >= 0; $count--)
Within the loop, $outfile is opened for writing but never used. If it is to be used, it should be opened once only, immediately before the loop.
The print statement is — well, a mess! Here is my guess as to what was intended:
print "\n", "pin($key_CSV) {\n", "direction : input ;\n", "capacitance : $DIN_CAP ;\n", "}\n", "\n", "internal_power(pwr_arc){\n", "values(\"$DIN_PWR_ARC\");\n", "related_input : \"$key_CSV\" ;\n";
Note that you should not try to combine newline control characters (\n) with literal newlines within a string. If you want a different quoting style here, have a look at <<EOF under perlop#Quote-Like-Operators.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: why i cant print reading hash table?
by GrandFather (Saint) on Nov 20, 2013 at 05:06 UTC | |
by Athanasius (Archbishop) on Nov 20, 2013 at 06:21 UTC | |
by GrandFather (Saint) on Nov 20, 2013 at 07:09 UTC | |
|
Re^2: why i cant print reading hash table?
by waytoperl (Beadle) on Nov 20, 2013 at 13:10 UTC | |
by VincentK (Beadle) on Nov 20, 2013 at 17:34 UTC |