There's more than one way to do things | |
PerlMonks |
Re^3: Accessing variables in an external hash without evalby Athanasius (Archbishop) |
on May 17, 2017 at 05:50 UTC ( [id://1190432]=note: print w/replies, xml ) | Need Help?? |
i get an error saying i cant use an undefined value as an array reference on the line with the push statement. Then the hash wasn’t correctly read-in from the data file. Have you fixed the format of the data as kevbot showed? Without further details (see The SSCCE), it’s impossible to know where the problem lies. <Update> Also because my function will be called multiple times will the global %hash variable be overwritten? Yes, of course, each time the subroutine is called the do $fileName; statement will overwrite %hash with the data in the indicated file. Hope that helps,
In Section
Seekers of Perl Wisdom
|
|