Thank you Athanasius for pointing out problems in code. Made recommended modifications.

Declared variables

$infile_CSV, $outfile_CSV, $outfile

Using 'Asyn...Arc' removes Bareword error

Using for (; $count >= 0; $count--)

Placed $outfile outside Loop.

The print is modified with EOF These introduce some syntax errors. <<EOF prints strings available till EOF. In my code there are syntax problems.

Most of the errors are removed. There are errors related to $key_CSV. Please take a look. Earlier logic was to search 'AsyncInNoTimingArc' from %hash values. Keep a count of occurrence in $count. Using $count in LOOP print a bunch of line by adding every corresponding %hash table $key_CSV for every occurrence of 'AsyncInNoTimingArc'. Please provide your insight logically its possible, where we can search a hash value, keep a count and in every LOOP iteration of value[] key[] use print statement and use content of key[]

EXAMPLE: Output of %hash have its respective $key_CSV and values. Search a %hash value, keep a $count and for every values print respective $key_CSV in print statement

Contents of %hash{}

$VAR1 = { 'REFCLK_BUF3' => [ 'AsyncOutNoTimingArc' ], 'C_WREN' => [ 'C_CLK_and_SCANCLK_L__IN' ], 'CAL_CLK' => [ 'AsyncInNoTimingArc' ], 'RX_IBIAS_2_25U[4:0]' => [ 'Power' ],

open (my $outfile1, '>>', "$outfile") or die "Unable to open $outfile: + $!\n"; for (; $count >= 0; $count--) { print <<" EOF"; pin($key_CSV) { direction : input ; capacitance : $DIN_CAP ; } internal_power(pwr_arc){ values(\"$DIN_PWR_ARC\"); related_input : \"$key_CSV\" ; } EOF

In reply to Re^2: why i cant print reading hash table? by waytoperl
in thread why i cant print reading hash table? by waytoperl

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.