| 1 | package Net::Azure::CognitiveServices::Face; | ||||||||||||||||||||
| 2 | 29 | ▶ | use 5.008001; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 29 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 29 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 29 | ▶ | use Net::Azure::CognitiveServices::Face::Face; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 29 | ▶ | use Net::Azure::CognitiveServices::Face::FaceList; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 29 | ▶ | use Net::Azure::CognitiveServices::Face::Person; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 29 | ▶ | use Net::Azure::CognitiveServices::Face::PersonGroup; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 29 | our $VERSION = "0.04"; | |||||||||||||||||||
| 11 | 29 | our $AUTOLOAD; | |||||||||||||||||||
| 12 | 29 | our $INSTANCES = {}; | |||||||||||||||||||
| 13 | 29 | our $ACCESS_KEY; | |||||||||||||||||||
| 14 | 29 | our $ENDPOINT = 'https://westus.api.cognitive.microsoft.com'; | |||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 28 | ▶ | sub access_key { | ||||||||||||||||||
|
Subroutine
access_key: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||
| 17 | 28 | my ($class, $key) = @_; | |||||||||||||||||||
| 18 | 28 | ▶ | if ($key) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 19 | 28 | $ACCESS_KEY = $key; | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | 28 | return $ACCESS_KEY; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 1 | ▶ | sub endpoint { | ||||||||||||||||||
|
Subroutine
endpoint: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||
| 25 | 1 | my ($class, $url) = @_; | |||||||||||||||||||
| 26 | 1 | ▶ | if ($url) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 27 | 1 | $ENDPOINT = $url; | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | 1 | return $ENDPOINT; | |||||||||||||||||||
| 30 | } | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 28 | ▶ | sub AUTOLOAD { | ||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=2 SCAR=7.4
| |||||||||||||||||||||
| 33 | 28 | my $class = shift; | |||||||||||||||||||
| 34 | 28 | my $subclass = $AUTOLOAD; | |||||||||||||||||||
| 35 | 28 | ▶ | $INSTANCES->{$subclass} ||= $subclass->new(access_key => $ACCESS_KEY, endpoint => $ENDPOINT); | ||||||||||||||||||
|
Condition33%1/3
$Net::Azure::CognitiveServices::Face::INSTANCES->{$subclass} ||= $subclass->new("access_key", $Net::Azure::CognitiveServices::Face::ACCESS_KEY, "endpoint", $Net::Azure::CognitiveServices::Face::ENDPOINT)
MC/DC0%0/2
$Net::Azure::CognitiveServices::Face::INSTANCES->{$subclass} ||= $subclass->new("access_key", $Net::Azure::CognitiveServices::Face::ACCESS_KEY, "endpoint", $Net::Azure::CognitiveServices::Face::ENDPOINT)
$Net::Azure::CognitiveServices::Face::INSTANCES->{$subclass}
$subclass->new("access_key", $Net::Azure::CognitiveServices::Face::ACCESS_KEY, "endpoint", $Net::Azure::CognitiveServices::Face::ENDPOINT)
Truth table33%1/3
A ||= B
A= $Net::Azure::CognitiveServices::Face::INSTANCES->{$subclass}B= $subclass->new("access_key", $Net::Azure::CognitiveServices::Face::ACCESS_KEY, "endpoint", $Net::Azure::CognitiveServices::Face::ENDPOINT)
| |||||||||||||||||||||
| 36 | 28 | $INSTANCES->{$subclass}; | |||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 29 | 1; | |||||||||||||||||||
| 40 | __END__ | ||||||||||||||||||||