Text-Bidi
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Text/Bidi.pm view on Meta::CPAN
}
sub new {
my $class = shift;
my $self = {
tie_byte => 'Text::Bidi::Array::Byte',
tie_long => 'Text::Bidi::Array::Long',
@_
};
bless $self => $class
}
sub tie_byte {
my $self = shift;
return \undef unless defined $_[0];
$self->{'tie_byte'}->new(@_)
}
sub tie_long {
lib/Text/Bidi/Array.pm view on Meta::CPAN
my $self = tie(my @magic, $class, @_);
$self->{'magic'} = \@magic;
$self
}
sub TIEARRAY {
my $class = shift;
my $data = shift || 0;
my $self = { @_ };
bless $self => $class;
$self->_init($data)
}
sub _init {
my ($self, $data) = @_;
if ( ref($data) ) {
my @data = eval { @$data };
croak $@ if $@;
$data = $self->pack(@data);
}
lib/Text/Bidi/Paragraph.pm view on Meta::CPAN
sub new {
my $class = shift;
my $par = shift;
my $self = { @_ };
my @bd = ($self->{'bd'});
$self->{'bd'} = Text::Bidi::S(@bd);
$self->{'par'} = $par;
$self->{'shape'} = 0
if $par =~ /[\p{bc=AL}\p{bc=AN}]/ and not exists $self->{'shape'};
bless $self => $class;
$self->_init
}
for my $f ( qw(par bd dir _par _mirpar _unicode _mirrored )) {
no strict 'refs';
*$f = sub { $_[0]->{$f} };
}
for my $f ( qw(len types levels map) ) {
view all matches for this distributionview release on metacpan - search on metacpan
( run in 2.099 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-d29e8ade9f55 )