08/01/18 15:33:05
いまいち頭の中でまとまってないけどuse strictを使い
cのヘッダファイルのように変数を一元管理するにはどうしたらいい?
例
##hoge.pl
use strict
$hoge = 'hoge';
print $hoge;
require 'piyo.pl';
print $hoge;
##piyo.pl
$hoge='piyo';
use strictコメントアウト時はhogepiyoだけど
Global symbol "$hoge" requires explicit package name at ./strict.pl line 3.
Global symbol "$hoge" requires explicit package name at ./strict.pl line 4.
Global symbol "$hoge" requires explicit package name at ./strict.pl line 6.
Execution of ./strict.pl aborted due to compilation errors.
と怒られるorz