Perlについての質問箱 34箱目
■ このスレッドは過去ログ倉庫に格納されています
0077デフォルトの名無しさん
2008/01/18(金) 15:33:05cのヘッダファイルのように変数を一元管理するにはどうしたらいい?
例
##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
■ このスレッドは過去ログ倉庫に格納されています