On 10/4/07 Michael Barto wrote: >I am working with an old Perl Library (program module) written in >Perl4 and Perl 5 depending who was "hacking the code". My program >that calls it, uses -w and strict and has identified many syntax >errors and so forth in the old library which I fixed. My problem is >that this library needs two variables passed as globals to it to use >in one of the subroutines, One of them is the $dbh variable created >when the database is open. Another is a hash. Both these variables >were initiated at the Main top most level of the program with "my". >Unfortunately, this causes an error and the libraries does not see the >global. If I turn off strict and the -w options and remove the "my" >from these variables assignments, the program works. What is going on? >I might point out that the start of the subroutine that is causing the >problem starts like this.
What version of perl is the revised program going to run under? Did you add the my() declaration to the two variables, or was it already there? What happens if you declare them with use vars qw/$dbh %hash/; instead? Best, - Bruce __bruce__van_allen__santa_cruz__ca__