Tuesday, April 10, 2007

Exporter

package Constant;
use strict;
BEGIN{
use Exporter;
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);

@ISA = qw(Exporter);
@EXPORT = qw(
HOGE
HOGE2
);
%EXPORT_TAGS = ();
@EXPORT_OK = ();
}

use constant HOGE => 'hoge';
use constant HOGE2 => 2;

1
~
-----

#!/usr/local/bin/perl

use Constant;

print HOGE2;

No comments: