Allow the pertinent Shiar_Sheet::KeySigns variable to be used without
importing.
use strict;
use warnings;
-our $VERSION = 'v1.02';
+our $VERSION = '1.03';
-sub import {
- my $class = shift;
-
- my %sign = (
+our %sign = (
arg => '·', # described as 'dot'
args => '⁚',
argi => '′',
left => '◀',
sep => '•',
_ => '<wbr>' || "\x{200b}", # unofficial html, correct ZWNJ character might appear as placeholder
- );
+);
+sub import {
+ # exports %sign
my ($parent) = caller;
eval '*'.$parent.'::sign = \%sign';
}
croak 'No key definitions specified' unless ref $self->{def} eq 'HASH';
$self->{map} ||= 'qwerty';
- my $parent = (caller)[0]; # calling module
- my $sign = do {
- no strict 'refs'; # temporarily allow variable references
- \%{ $parent.'::sign' }; # return %sign from parent
+ $self->{sign} ||= do {
+ require Shiar_Sheet::KeySigns;
+ Shiar_Sheet::KeySigns->VERSION(1.03);
+ \%Shiar_Sheet::KeySigns::sign;
};
- croak "%${parent}::sign not found" unless %$sign;
- $self->{sign} = $sign;
bless $self, $class;
}