| 1 | package Net::FreeDB2; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # Copyright 2002, Vincenzo Zocca. | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | # See LICENSE section for usage and distribution rights. | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | require 5.005_62; | |||||||||||||||||||||||||||
| 8 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 1 | require Exporter; | |||||||||||||||||||||||||||
| 12 | 1 | ▶ | use AutoLoader qw(AUTOLOAD); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use Error qw (:try); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 1 | our @ISA = qw(Exporter); | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | # Items to export into callers namespace by default. Note: do not export | ||||||||||||||||||||||||||||
| 18 | # names by default without a very good reason. Use EXPORT_OK instead. | ||||||||||||||||||||||||||||
| 19 | # Do not simply export all your public functions/methods/constants. | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | # This allows declaration use Net::FreeDB2 ':all'; | ||||||||||||||||||||||||||||
| 22 | # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK | ||||||||||||||||||||||||||||
| 23 | # will save memory. | ||||||||||||||||||||||||||||
| 24 | 1 | our %EXPORT_TAGS = ( 'all' => [ qw( | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | ) ] ); | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 1 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 1 | our @EXPORT = qw( | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | ); | ||||||||||||||||||||||||||||
| 33 | 1 | our ( $VERSION ) = '$Revision: 0.8.2.6 $ ' =~ /\$Revision:\s+([^\s]+)/; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub connection { | ||||||||||||||||||||||||||
|
Subroutine
connection: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||
| 36 | # Allow both styles Net::FreeDB2->connection and Net::FreeDB2::connection | ||||||||||||||||||||||||||||
| 37 | 0 | ▶ | $_[0] eq 'Net::FreeDB2' && shift; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | # Get options | ||||||||||||||||||||||||||||
| 40 | 0 | my $opt; | |||||||||||||||||||||||||||
| 41 | 0 | ▶ | if (ref ($_[0]) eq 'HASH') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | 0 | $opt = shift; | |||||||||||||||||||||||||||
| 43 | } else { | ||||||||||||||||||||||||||||
| 44 | 0 | $opt = {}; | |||||||||||||||||||||||||||
| 45 | 0 | foreach my $av (split (/\s*;+\s*/, shift)) { | |||||||||||||||||||||||||||
| 46 | 0 | my ($a, $v) = split (/\s*=\s*/, $av); | |||||||||||||||||||||||||||
| 47 | 0 | ▶ | $a && $v || next; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$a and $v
MC/DC0%0/2
$a and $v
$a
$v
Truth table0%0/3
A and B
A= $aB= $v
| |||||||||||||||||||||||||||||
| 48 | 0 | $opt->{$a} = $v; | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | 0 | ▶ | if (defined ($opt->{protocol}) && $opt->{protocol} eq 'CDDBP') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $opt->{"protocol"} and $opt->{"protocol"} eq "CDDBP"
MC/DC0%0/2
defined $opt->{"protocol"} and $opt->{"protocol"} eq "CDDBP"
defined $opt->{"protocol"}
$opt->{"protocol"} eq "CDDBP"
Truth table0%0/3
A and B
A= defined $opt->{"protocol"}B= $opt->{"protocol"} eq "CDDBP"
| |||||||||||||||||||||||||||||
| 53 | 0 | require Net::FreeDB2::Connection::CDDBP; | |||||||||||||||||||||||||||
| 54 | 0 | import Net::FreeDB2::Connection::CDDBP; | |||||||||||||||||||||||||||
| 55 | 0 | return (Net::FreeDB2::Connection::CDDBP->new ($opt)); | |||||||||||||||||||||||||||
| 56 | } else { | ||||||||||||||||||||||||||||
| 57 | 0 | require Net::FreeDB2::Connection::HTTP; | |||||||||||||||||||||||||||
| 58 | 0 | import Net::FreeDB2::Connection::HTTP; | |||||||||||||||||||||||||||
| 59 | 0 | return (Net::FreeDB2::Connection::HTTP->new ($opt)); | |||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | 1 | 1; | |||||||||||||||||||||||||||
| 65 | __END__ | ||||||||||||||||||||||||||||