File: test.pl

package info (click to toggle)
libconstant-generate-perl 0.17-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 156 kB
  • sloc: perl: 465; makefile: 2
file content (23 lines) | stat: -rwxr-xr-x 521 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl
package My::Constant::Module;
use base qw(Exporter);
use blib;
our (@EXPORT, @EXPORT_OK, %EXPORT_TAGS);

use Constant::Generate
	[qw(MOO COW)],
	-tag => "some_constants",
	-type => "int",
	-export => 1,
	-export_tags => 1,
	-start_at => 32;
	
package My::User::Module;
use strict;
use warnings;
BEGIN {
	My::Constant::Module->import(qw(:some_constants));
}
my ($animal,$noise) = (COW,MOO);
printf("%s is known to make lots of %s noises\n",
	some_constants_to_str($animal), some_constants_to_str($noise));