`use` package scope: how to make it cross files?

前端 未结 3 1475
-上瘾入骨i
-上瘾入骨i 2021-01-13 06:06

In scriptA.pl, there is use DBI

In scriptB.pl, there is require \"scriptA.pl\"

But we still cannot use DB

3条回答
  •  心在旅途
    2021-01-13 06:24

    There are ways, but they are all more ugly, hacky and unclean than simply typing use DBI; in every file that uses it. This is the best practice and is quite normal.

提交回复
热议问题