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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |