public
Description:
Homepage:
Clone URL: git://github.com/robertkrimen/path-abstract.git
path-abstract / profile-Path-Abstract.pl
100644 42 lines (35 sloc) 0.831 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/perl -w
 
use strict;
 
use Path::Abstract;
use Path::Abstract::Fast;
 
use constant class => 1 ? qw/Path::Abstract/ : qw/Path::Abstract::Fast/;
 
warn "Using ", class;
 
srand 30;
 
my $count = shift @ARGV || 10000;
if (0) {
my $path = class->new;
while ($count--) {
$path = class->new if $count % 10;
$path = int rand 2 ? $path->child($count) : $path->child($count);
}
}
elsif (1) {
my $path = class->new;
    my $got;
while ($count--) {
$path = $path->child(sprintf '%x', int rand 3600);
        $got .= ref $path eq "Path::Abstract::Fast" ? $path->get : "$path";
}
}
elsif (1) {
my $path = class->new;
while ($count--) {
$path = $path->child(sprintf '%x', int rand 3600);
}
}
elsif (1) {
my $path = class->new;
while ($count--) {
$path = int rand 2 ? $path->child($count) : $path->child($count);
}
}