… | |
… | |
72 | |
72 | |
73 | package Net::FCP; |
73 | package Net::FCP; |
74 | |
74 | |
75 | use Carp; |
75 | use Carp; |
76 | |
76 | |
77 | $VERSION = 0.5; |
77 | $VERSION = 0.6; |
78 | |
78 | |
79 | no warnings; |
79 | no warnings; |
80 | |
80 | |
81 | our $EVENT = Net::FCP::Event::Auto::; |
81 | our $EVENT = Net::FCP::Event::Auto::; |
82 | |
82 | |
… | |
… | |
99 | $_; |
99 | $_; |
100 | } |
100 | } |
101 | |
101 | |
102 | sub tolc($) { |
102 | sub tolc($) { |
103 | local $_ = shift; |
103 | local $_ = shift; |
|
|
104 | 1 while s/(SVK|CHK|URI)/\L$1\_/; |
104 | s/(?<=[a-z])(?=[A-Z])/_/g; |
105 | s/(?<=[a-z])(?=[A-Z])/_/g; |
105 | lc $_; |
106 | lc $_; |
106 | } |
107 | } |
107 | |
108 | |
108 | # the opposite of hex |
109 | # the opposite of hex |
… | |
… | |
413 | |
414 | |
414 | =cut |
415 | =cut |
415 | |
416 | |
416 | $txn->(client_get => sub { |
417 | $txn->(client_get => sub { |
417 | my ($self, $uri, $htl, $removelocal) = @_; |
418 | my ($self, $uri, $htl, $removelocal) = @_; |
|
|
419 | |
|
|
420 | $uri =~ s/^freenet://; |
|
|
421 | $uri = "freenet:$uri"; |
418 | |
422 | |
419 | $self->txn (client_get => URI => $uri, hops_to_live => xeh (defined $htl ? $htl : 15), |
423 | $self->txn (client_get => URI => $uri, hops_to_live => xeh (defined $htl ? $htl : 15), |
420 | remove_local_key => $removelocal ? "true" : "false"); |
424 | remove_local_key => $removelocal ? "true" : "false"); |
421 | }); |
425 | }); |
422 | |
426 | |