… | |
… | |
17 | of what the messages do. I am too lazy to document all this here. |
17 | of what the messages do. I am too lazy to document all this here. |
18 | |
18 | |
19 | =head1 WARNING |
19 | =head1 WARNING |
20 | |
20 | |
21 | This module is alpha. While it probably won't destroy (much :) of your |
21 | This module is alpha. While it probably won't destroy (much :) of your |
22 | data, it currently works only with the Event module (alkthough the event |
22 | data, it currently falls short of what it should provide (intelligent uri |
23 | mechanism is fully pluggable). |
23 | following, splitfile downloads, healing...) |
|
|
24 | |
|
|
25 | =head2 IMPORT TAGS |
|
|
26 | |
|
|
27 | Nothing much can be "imported" from this module right now. There are, |
|
|
28 | however, certain "import tags" that can be used to select the event model |
|
|
29 | to be used. |
|
|
30 | |
|
|
31 | Event models are implemented as modules under the C<Net::FCP::Event::xyz> |
|
|
32 | class, where C<xyz> is the event model to use. The default is C<Event> (or |
|
|
33 | later C<Auto>). |
|
|
34 | |
|
|
35 | The import tag to use is named C<event=xyz>, e.g. C<event=Event>, |
|
|
36 | C<event=Glib> etc. |
|
|
37 | |
|
|
38 | You should specify the event module to use only in the main program. |
24 | |
39 | |
25 | =head2 THE Net::FCP CLASS |
40 | =head2 THE Net::FCP CLASS |
26 | |
41 | |
27 | =over 4 |
42 | =over 4 |
28 | |
43 | |
… | |
… | |
31 | package Net::FCP; |
46 | package Net::FCP; |
32 | |
47 | |
33 | use Carp; |
48 | use Carp; |
34 | use IO::Socket::INET; |
49 | use IO::Socket::INET; |
35 | |
50 | |
36 | $VERSION = 0.02; |
51 | $VERSION = 0.05; |
37 | |
52 | |
38 | sub event_reg_cb { |
53 | no warnings; |
39 | my ($obj) = @_; |
|
|
40 | require Event; |
|
|
41 | |
54 | |
42 | $obj->{eventdata} = Event->io ( |
55 | our $EVENT = Net::FCP::Event::Auto::; |
43 | fd => $obj->{fh}, |
56 | $EVENT = Net::FCP::Event::Event;#d# |
44 | poll => 'r', |
57 | |
45 | cb => sub { |
58 | sub import { |
46 | $obj->fh_ready; |
59 | shift; |
|
|
60 | |
|
|
61 | for (@_) { |
|
|
62 | if (/^event=(\w+)$/) { |
|
|
63 | $EVENT = "Net::FCP::Event::$1"; |
47 | }, |
64 | } |
48 | ); |
65 | } |
|
|
66 | eval "require $EVENT"; |
49 | } |
67 | } |
50 | |
|
|
51 | sub event_unreg_cb { |
|
|
52 | $_[0]{eventdata} |
|
|
53 | and (delete $_[0]{eventdata})->cancel; |
|
|
54 | } |
|
|
55 | |
|
|
56 | sub event_wait_cb { |
|
|
57 | Event::one_event(); |
|
|
58 | } |
|
|
59 | |
|
|
60 | $regcb = \&event_reg_cb; |
|
|
61 | $unregcb = \&event_unreg_cb; |
|
|
62 | $waitcb = \&event_wait_cb; |
|
|
63 | |
68 | |
64 | sub touc($) { |
69 | sub touc($) { |
65 | local $_ = shift; |
70 | local $_ = shift; |
66 | 1 while s/((?:^|_)(?:svk|chk|uri)(?:_|$))/\U$1/; |
71 | 1 while s/((?:^|_)(?:svk|chk|uri)(?:_|$))/\U$1/; |
67 | s/(?:^|_)(.)/\U$1/g; |
72 | s/(?:^|_)(.)/\U$1/g; |
… | |
… | |
72 | local $_ = shift; |
77 | local $_ = shift; |
73 | s/(?<=[a-z])(?=[A-Z])/_/g; |
78 | s/(?<=[a-z])(?=[A-Z])/_/g; |
74 | lc $_; |
79 | lc $_; |
75 | } |
80 | } |
76 | |
81 | |
|
|
82 | =item $meta = Net::FCP::parse_metadata $string |
|
|
83 | |
|
|
84 | Parse a metadata string and return it. |
|
|
85 | |
|
|
86 | The metadata will be a hashref with key C<version> (containing |
|
|
87 | the mandatory version header entries). |
|
|
88 | |
|
|
89 | All other headers are represented by arrayrefs (they can be repeated). |
|
|
90 | |
|
|
91 | Since this is confusing, here is a rather verbose example of a parsed |
|
|
92 | manifest: |
|
|
93 | |
|
|
94 | ( |
|
|
95 | version => { revision => 1 }, |
|
|
96 | document => [ |
|
|
97 | { |
|
|
98 | "info.format" => "image/jpeg", |
|
|
99 | name => "background.jpg", |
|
|
100 | "redirect.target" => "freenet:CHK\@ZcagI,ra726bSw" |
|
|
101 | }, |
|
|
102 | { |
|
|
103 | "info.format" => "text/html", |
|
|
104 | name => ".next", |
|
|
105 | "redirect.target" => "freenet:SSK\@ilUPAgM/TFEE/3" |
|
|
106 | }, |
|
|
107 | { |
|
|
108 | "info.format" => "text/html", |
|
|
109 | "redirect.target" => "freenet:CHK\@8M8Po8ucwI,8xA" |
|
|
110 | } |
|
|
111 | ] |
|
|
112 | ) |
|
|
113 | |
|
|
114 | =cut |
|
|
115 | |
|
|
116 | sub parse_metadata { |
|
|
117 | my $meta; |
|
|
118 | |
|
|
119 | my $data = shift; |
|
|
120 | if ($data =~ /^Version\015?\012/gc) { |
|
|
121 | my $hdr = $meta->{version} = {}; |
|
|
122 | |
|
|
123 | for (;;) { |
|
|
124 | while ($data =~ /\G([^=\015\012]+)=([^\015\012]*)\015?\012/gc) { |
|
|
125 | my ($k, $v) = ($1, $2); |
|
|
126 | $hdr->{tolc $k} = $v; |
|
|
127 | } |
|
|
128 | |
|
|
129 | if ($data =~ /\GEndPart\015?\012/gc) { |
|
|
130 | } elsif ($data =~ /\GEnd\015?\012/gc) { |
|
|
131 | last; |
|
|
132 | } elsif ($data =~ /\G([A-Za-z0-9.\-]+)\015?\012/gcs) { |
|
|
133 | push @{$meta->{tolc $1}}, $hdr = {}; |
|
|
134 | } elsif ($data =~ /\G(.*)/gcs) { |
|
|
135 | die "metadata format error ($1)"; |
|
|
136 | } |
|
|
137 | } |
|
|
138 | } |
|
|
139 | |
|
|
140 | #$meta->{tail} = substr $data, pos $data; |
|
|
141 | |
|
|
142 | $meta; |
|
|
143 | } |
|
|
144 | |
77 | =item $fcp = new Net::FCP [host => $host][, port => $port] |
145 | =item $fcp = new Net::FCP [host => $host][, port => $port] |
78 | |
146 | |
79 | Create a new virtual FCP connection to the given host and port (default |
147 | Create a new virtual FCP connection to the given host and port (default |
80 | 127.0.0.1:8481). |
148 | 127.0.0.1:8481, or the environment variables C<FREDHOST> and C<FREDPORT>). |
81 | |
149 | |
82 | Connections are virtual because no persistent physical connection is |
150 | Connections are virtual because no persistent physical connection is |
83 | established. However, the existance of the node is checked by executing a |
151 | established. However, the existance of the node is checked by executing a |
84 | C<ClientHello> transaction. |
152 | C<ClientHello> transaction. |
85 | |
153 | |
… | |
… | |
87 | |
155 | |
88 | sub new { |
156 | sub new { |
89 | my $class = shift; |
157 | my $class = shift; |
90 | my $self = bless { @_ }, $class; |
158 | my $self = bless { @_ }, $class; |
91 | |
159 | |
92 | $self->{host} ||= "127.0.0.1"; |
160 | $self->{host} ||= $ENV{FREDHOST} || "127.0.0.1"; |
93 | $self->{port} ||= 8481; |
161 | $self->{port} ||= $ENV{FREDPORt} || 8481; |
94 | |
162 | |
95 | $self->{nodehello} = $self->txn("ClientHello")->result |
163 | $self->{nodehello} = $self->client_hello |
96 | or croak "unable to get nodehello from node\n"; |
164 | or croak "unable to get nodehello from node\n"; |
97 | |
165 | |
98 | $self; |
166 | $self; |
|
|
167 | } |
|
|
168 | |
|
|
169 | sub progress { |
|
|
170 | my ($self, $txn, $type, $attr) = @_; |
|
|
171 | warn "progress<$txn,$type," . (join ":", %$attr) . ">\n"; |
99 | } |
172 | } |
100 | |
173 | |
101 | =item $txn = $fcp->txn(type => attr => val,...) |
174 | =item $txn = $fcp->txn(type => attr => val,...) |
102 | |
175 | |
103 | The low-level interface to transactions. Don't use it. |
176 | The low-level interface to transactions. Don't use it. |
… | |
… | |
187 | =cut |
260 | =cut |
188 | |
261 | |
189 | _txn generate_chk => sub { |
262 | _txn generate_chk => sub { |
190 | my ($self, $metadata, $data) = @_; |
263 | my ($self, $metadata, $data) = @_; |
191 | |
264 | |
192 | $self->txn (generate_chk => data => "$data$metadata", meta_data_length => length $metadata); |
265 | $self->txn (generate_chk => data => "$data$metadata", metadata_length => length $metadata); |
193 | }; |
266 | }; |
194 | |
267 | |
195 | =item $txn = $fcp->txn_generate_svk_pair |
268 | =item $txn = $fcp->txn_generate_svk_pair |
196 | |
269 | |
197 | =item ($public, $private) = @{ $fcp->generate_svk_pair } |
270 | =item ($public, $private) = @{ $fcp->generate_svk_pair } |
… | |
… | |
246 | my ($self, $uri) = @_; |
319 | my ($self, $uri) = @_; |
247 | |
320 | |
248 | $self->txn (get_size => URI => $uri); |
321 | $self->txn (get_size => URI => $uri); |
249 | }; |
322 | }; |
250 | |
323 | |
|
|
324 | =item $txn = $fcp->txn_client_get ($uri [, $htl = 15 [, $removelocal = 0]]) |
|
|
325 | |
|
|
326 | =item ($metadata, $data) = @{ $fcp->client_get ($uri, $htl, $removelocal) |
|
|
327 | |
|
|
328 | Fetches a (small, as it should fit into memory) file from |
|
|
329 | freenet. C<$meta> is the metadata (as returned by C<parse_metadata> or |
|
|
330 | C<undef>). |
|
|
331 | |
|
|
332 | Due to the overhead, a better method to download big files should be used. |
|
|
333 | |
|
|
334 | my ($meta, $data) = @{ |
|
|
335 | $fcp->client_get ( |
|
|
336 | "freenet:CHK@hdXaxkwZ9rA8-SidT0AN-bniQlgPAwI,XdCDmBuGsd-ulqbLnZ8v~w" |
|
|
337 | ) |
|
|
338 | }; |
|
|
339 | |
|
|
340 | =cut |
|
|
341 | |
|
|
342 | _txn client_get => sub { |
|
|
343 | my ($self, $uri, $htl, $removelocal) = @_; |
|
|
344 | |
|
|
345 | $self->txn (client_get => URI => $uri, hops_to_live => ($htl || 15), remove_local => $removelocal*1); |
|
|
346 | }; |
|
|
347 | |
251 | =item MISSING: ClientGet, ClientPut |
348 | =item MISSING: ClientPut |
252 | |
349 | |
253 | =back |
350 | =back |
254 | |
351 | |
255 | =head2 THE Net::FCP::Txn CLASS |
352 | =head2 THE Net::FCP::Txn CLASS |
256 | |
353 | |
… | |
… | |
315 | |
412 | |
316 | #$fh->shutdown (1); # freenet buggy?, well, it's java... |
413 | #$fh->shutdown (1); # freenet buggy?, well, it's java... |
317 | |
414 | |
318 | $self->{fh} = $fh; |
415 | $self->{fh} = $fh; |
319 | |
416 | |
320 | $Net::FCP::regcb->($self); |
417 | $EVENT->reg_r_cb ($self); |
321 | |
418 | |
322 | $self; |
419 | $self; |
|
|
420 | } |
|
|
421 | |
|
|
422 | =item $userdata = $txn->userdata ([$userdata]) |
|
|
423 | |
|
|
424 | Get and/or set user-specific data. This is useful in progress callbacks. |
|
|
425 | |
|
|
426 | =cut |
|
|
427 | |
|
|
428 | sub userdata($;$) { |
|
|
429 | my ($self, $data) = @_; |
|
|
430 | $self->{userdata} = $data if @_ >= 2; |
|
|
431 | $self->{userdata}; |
323 | } |
432 | } |
324 | |
433 | |
325 | sub fh_ready { |
434 | sub fh_ready { |
326 | my ($self) = @_; |
435 | my ($self) = @_; |
327 | |
436 | |
328 | if (sysread $self->{fh}, $self->{buf}, 65536, length $self->{buf}) { |
437 | if (sysread $self->{fh}, $self->{buf}, 65536, length $self->{buf}) { |
329 | for (;;) { |
438 | for (;;) { |
330 | if ($self->{datalen}) { |
439 | if ($self->{datalen}) { |
331 | if (length $self->{buf} >= $self->{datalen}) { |
440 | if (length $self->{buf} >= $self->{datalen}) { |
332 | $self->recv_data (substr $self->{buf}, 0, $self->{datalen}, ""); |
441 | $self->rcv_data (substr $self->{buf}, 0, delete $self->{datalen}, ""); |
333 | } else { |
442 | } else { |
334 | last; |
443 | last; |
335 | } |
444 | } |
336 | } elsif ($self->{buf} =~ s/^DataChunk\015?\012Length=(\d+)\015?\012Data\015?\012//) { |
445 | } elsif ($self->{buf} =~ s/^DataChunk\015?\012Length=([0-9a-fA-F]+)\015?\012Data\015?\012//) { |
337 | $self->{datalen} = $1; |
446 | $self->{datalen} = hex $1; |
338 | } elsif ($self->{buf} =~ s/^([a-zA-Z]+)\015?\012(.*?)\015?\012EndMessage\015?\012//s) { |
447 | } elsif ($self->{buf} =~ s/^([a-zA-Z]+)\015?\012(?:(.+?)\015?\012)?EndMessage\015?\012//s) { |
339 | $self->rcv ($1, { |
448 | $self->rcv ($1, { |
340 | map { my ($a, $b) = split /=/, $_, 2; ((Net::FCP::tolc $a), $b) } |
449 | map { my ($a, $b) = split /=/, $_, 2; ((Net::FCP::tolc $a), $b) } |
341 | split /\015?\012/, $2 |
450 | split /\015?\012/, $2 |
342 | }); |
451 | }); |
343 | } else { |
452 | } else { |
344 | last; |
453 | last; |
345 | } |
454 | } |
346 | } |
455 | } |
347 | } else { |
456 | } else { |
348 | $Net::FCP::unregcb->($self); |
457 | $EVENT->unreg_r_cb ($self); |
349 | delete $self->{fh}; |
458 | delete $self->{fh}; |
350 | $self->eof; |
459 | $self->eof; |
351 | } |
460 | } |
352 | } |
461 | } |
353 | |
462 | |
354 | sub rcv_data { |
463 | sub rcv_data { |
355 | my ($self, $chunk) = @_; |
464 | my ($self, $chunk) = @_; |
|
|
465 | |
|
|
466 | $self->{data} .= $chunk; |
|
|
467 | |
|
|
468 | $self->progress ("data", { chunk => length $chunk, total => length $self->{data}, end => $self->{datalength} }); |
356 | } |
469 | } |
357 | |
470 | |
358 | sub rcv { |
471 | sub rcv { |
359 | my ($self, $type, $attr) = @_; |
472 | my ($self, $type, $attr) = @_; |
360 | |
473 | |
361 | $type = Net::FCP::tolc $type; |
474 | $type = Net::FCP::tolc $type; |
|
|
475 | |
|
|
476 | #use PApp::Util; warn PApp::Util::dumpval [$type, $attr]; |
362 | |
477 | |
363 | if (my $method = $self->can("rcv_$type")) { |
478 | if (my $method = $self->can("rcv_$type")) { |
364 | $method->($self, $attr, $type); |
479 | $method->($self, $attr, $type); |
365 | } else { |
480 | } else { |
366 | warn "received unexpected reply type '$type' for '$self->{type}', ignoring\n"; |
481 | warn "received unexpected reply type '$type' for '$self->{type}', ignoring\n"; |
367 | $self->eof; |
|
|
368 | } |
482 | } |
|
|
483 | } |
|
|
484 | |
|
|
485 | sub throw { |
|
|
486 | my ($self, $exc) = @_; |
|
|
487 | |
|
|
488 | $self->{exception} = $exc; |
|
|
489 | $self->set_result (1); |
|
|
490 | } |
|
|
491 | |
|
|
492 | sub set_result { |
|
|
493 | my ($self, $result) = @_; |
|
|
494 | |
|
|
495 | $self->{result} = $result unless exists $self->{result}; |
369 | } |
496 | } |
370 | |
497 | |
371 | sub eof { |
498 | sub eof { |
372 | my ($self, $result) = @_; |
499 | my ($self) = @_; |
|
|
500 | $self->set_result; |
|
|
501 | } |
373 | |
502 | |
374 | $self->{result} = $result unless exists $self->{result}; |
503 | sub progress { |
|
|
504 | my ($self, $type, $attr) = @_; |
|
|
505 | $self->{fcp}->progress ($self, $type, $attr); |
375 | } |
506 | } |
376 | |
507 | |
377 | =item $result = $txn->result |
508 | =item $result = $txn->result |
378 | |
509 | |
379 | Waits until a result is available and then returns it. |
510 | Waits until a result is available and then returns it. |
380 | |
511 | |
381 | This waiting is (depending on your event modul) not very efficient, as it |
512 | This waiting is (depending on your event model) not very efficient, as it |
382 | is done outside the "mainloop". |
513 | is done outside the "mainloop". |
383 | |
514 | |
384 | =cut |
515 | =cut |
385 | |
516 | |
386 | sub result { |
517 | sub result { |
387 | my ($self) = @_; |
518 | my ($self) = @_; |
388 | |
519 | |
389 | $Net::FCP::waitcb->() while !exists $self->{result}; |
520 | $EVENT->wait_event while !exists $self->{result}; |
|
|
521 | |
|
|
522 | die $self->{exception} if $self->{exception}; |
390 | |
523 | |
391 | return $self->{result}; |
524 | return $self->{result}; |
392 | } |
525 | } |
393 | |
526 | |
394 | sub DESTROY { |
527 | sub DESTROY { |
395 | $Net::FCP::unregcb->($_[0]); |
528 | $EVENT->unreg_r_cb ($_[0]); |
|
|
529 | #$EVENT->unreg_w_cb ($_[0]); |
396 | } |
530 | } |
397 | |
531 | |
398 | package Net::FCP::Txn::ClientHello; |
532 | package Net::FCP::Txn::ClientHello; |
399 | |
533 | |
400 | use base Net::FCP::Txn; |
534 | use base Net::FCP::Txn; |
401 | |
535 | |
402 | sub rcv_node_hello { |
536 | sub rcv_node_hello { |
403 | my ($self, $attr) = @_; |
537 | my ($self, $attr) = @_; |
404 | |
538 | |
405 | $self->eof ($attr); |
539 | $self->set_result ($attr); |
406 | } |
540 | } |
407 | |
541 | |
408 | package Net::FCP::Txn::ClientInfo; |
542 | package Net::FCP::Txn::ClientInfo; |
409 | |
543 | |
410 | use base Net::FCP::Txn; |
544 | use base Net::FCP::Txn; |
411 | |
545 | |
412 | sub rcv_node_info { |
546 | sub rcv_node_info { |
413 | my ($self, $attr) = @_; |
547 | my ($self, $attr) = @_; |
414 | |
548 | |
415 | $self->eof ($attr); |
549 | $self->set_result ($attr); |
416 | } |
550 | } |
417 | |
551 | |
418 | package Net::FCP::Txn::GenerateCHK; |
552 | package Net::FCP::Txn::GenerateCHK; |
419 | |
553 | |
420 | use base Net::FCP::Txn; |
554 | use base Net::FCP::Txn; |
421 | |
555 | |
422 | sub rcv_success { |
556 | sub rcv_success { |
423 | my ($self, $attr) = @_; |
557 | my ($self, $attr) = @_; |
424 | |
558 | |
425 | $self->eof ($attr); |
559 | $self->set_result ($attr); |
426 | } |
560 | } |
427 | |
561 | |
428 | package Net::FCP::Txn::GenerateSVKPair; |
562 | package Net::FCP::Txn::GenerateSVKPair; |
429 | |
563 | |
430 | use base Net::FCP::Txn; |
564 | use base Net::FCP::Txn; |
431 | |
565 | |
432 | sub rcv_success { |
566 | sub rcv_success { |
433 | my ($self, $attr) = @_; |
567 | my ($self, $attr) = @_; |
434 | |
568 | |
435 | $self->eof ([$attr->{PublicKey}, $attr->{PrivateKey}]); |
569 | $self->set_result ([$attr->{PublicKey}, $attr->{PrivateKey}]); |
436 | } |
570 | } |
437 | |
571 | |
438 | package Net::FCP::Txn::InvertPrivateKey; |
572 | package Net::FCP::Txn::InvertPrivateKey; |
439 | |
573 | |
440 | use base Net::FCP::Txn; |
574 | use base Net::FCP::Txn; |
441 | |
575 | |
442 | sub rcv_success { |
576 | sub rcv_success { |
443 | my ($self, $attr) = @_; |
577 | my ($self, $attr) = @_; |
444 | |
578 | |
445 | $self->eof ($attr->{PublicKey}); |
579 | $self->set_result ($attr->{PublicKey}); |
446 | } |
580 | } |
447 | |
581 | |
448 | package Net::FCP::Txn::GetSize; |
582 | package Net::FCP::Txn::GetSize; |
449 | |
583 | |
450 | use base Net::FCP::Txn; |
584 | use base Net::FCP::Txn; |
451 | |
585 | |
452 | sub rcv_success { |
586 | sub rcv_success { |
453 | my ($self, $attr) = @_; |
587 | my ($self, $attr) = @_; |
454 | |
588 | |
455 | $self->eof ($attr->{Length}); |
589 | $self->set_result ($attr->{Length}); |
|
|
590 | } |
|
|
591 | |
|
|
592 | package Net::FCP::Txn::ClientGet; |
|
|
593 | |
|
|
594 | use base Net::FCP::Txn; |
|
|
595 | |
|
|
596 | sub rcv_data_found { |
|
|
597 | my ($self, $attr, $type) = @_; |
|
|
598 | |
|
|
599 | $self->progress ($type, $attr); |
|
|
600 | |
|
|
601 | $self->{datalength} = hex $attr->{data_length}; |
|
|
602 | $self->{metalength} = hex $attr->{metadata_length}; |
|
|
603 | } |
|
|
604 | |
|
|
605 | sub rcv_route_not_found { |
|
|
606 | my ($self, $attr, $type) = @_; |
|
|
607 | |
|
|
608 | $self->throw (new Net::FCP::Exception $type, $attr); |
|
|
609 | } |
|
|
610 | |
|
|
611 | sub rcv_data_not_found { |
|
|
612 | my ($self, $attr, $type) = @_; |
|
|
613 | |
|
|
614 | $self->throw (new Net::FCP::Exception $type, $attr); |
|
|
615 | } |
|
|
616 | |
|
|
617 | sub rcv_format_error { |
|
|
618 | my ($self, $attr, $type) = @_; |
|
|
619 | |
|
|
620 | $self->throw (new Net::FCP::Exception $type, $attr); |
|
|
621 | } |
|
|
622 | |
|
|
623 | sub rcv_restarted { |
|
|
624 | my ($self, $attr, $type) = @_; |
|
|
625 | $self->progress ($type, $attr); |
|
|
626 | } |
|
|
627 | |
|
|
628 | sub eof { |
|
|
629 | my ($self) = @_; |
|
|
630 | |
|
|
631 | my $data = delete $self->{data}; |
|
|
632 | my $meta = Net::FCP::parse_metadata substr $data, 0, $self->{metalength}, ""; |
|
|
633 | |
|
|
634 | $self->set_result ([$meta, $data]); |
|
|
635 | } |
|
|
636 | |
|
|
637 | package Net::FCP::Exception; |
|
|
638 | |
|
|
639 | use overload |
|
|
640 | '""' => sub { |
|
|
641 | "Net::FCP::Exception<<$_[0][0]," . (join ":", %{$_[0][1]}) . ">>\n"; |
|
|
642 | }; |
|
|
643 | |
|
|
644 | sub new { |
|
|
645 | my ($class, $type, $attr) = @_; |
|
|
646 | |
|
|
647 | bless [$type, { %$attr }], $class; |
456 | } |
648 | } |
457 | |
649 | |
458 | =back |
650 | =back |
459 | |
651 | |
460 | =head1 SEE ALSO |
652 | =head1 SEE ALSO |