traxlog has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,
I have written several programs which all require a module I wrote. In the module I have called use DB_File so I can tie to the various DB's.
However, in the program I am using $st = $DB->seq($key,$value, R_NEXT); and this won't work unless I also use DB_File in the program as well.
Why does this need to be called 2 times? Is it bad to call it twice?
T.I.A
traxlog

Replies are listed 'Best First'.
Re: Why do I have to call use DB_File twice? (in program AND module)
by perrin (Chancellor) on Sep 22, 2003 at 19:40 UTC
    It's because "R_NEXT" is a subroutine that you are importing when you say "use DB_File". You could probably avoid the call to "use" by saying DB_File::R_NEXT instead.
      Aha!
      Thanks very much!