ObjStore
view release on metacpan or search on metacpan
lib/ObjStore/PathExam/Path.pm view on Meta::CPAN
use strict;
package ObjStore::PathExam::Path;
use Carp;
use base 'ObjStore::AV';
sub new {
use attrs 'method';
my ($class, $near, $path) = @_;
my @comp = split m",\s*", $path;
croak "$class->new($path): invalid" if @comp==0;
my $o = $class->SUPER::new($near, scalar @comp);
for (my $x=0; $x < @comp; $x++) {
my @c = split m"\/", $comp[$x];
croak "$class->new($path): '$comp[$x]' too long" if @c > 7;
$o->[$x] = [map { "$_\0" } @c];
}
$o;
}
sub stringify {
use attrs 'method';
my $paths = shift;
my @ps;
lib/ObjStore/Posh/Cursor.pm view on Meta::CPAN
}
} elsif ($to =~ m/^([+-])$/) {
my $at = $1 eq '-' ? $$o{at}+1 : $$o{at}-1;
if ($at >= 0 and $at < @$w) {
@at = map { $_->focus } @{ $$w[$at] };
if ($update) {
$$o{at} = $at;
}
}
} elsif ($to =~ m,^[\w\/\.\:\-]+$,) {
my @to = split m'/+', $to;
for my $t (@to) {
next if $t eq '.';
if ($t eq '..') {
pop @at if @at;
} else {
my $at = $at[$#at];
if ($at->can('POSH_CD')) {
$at = $at->POSH_CD($t);
$at = $at->POSH_ENTER()
if blessed $at && $at->can('POSH_ENTER');
( run in 2.745 seconds using v1.01-cache-2.11-cpan-71847e10f99 )