| 1 | package Math::Matlab; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use vars qw($VERSION $Revision); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 3 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 3 | $VERSION = '0.08'; | |||||||||
| 8 | 3 | $Revision = sprintf "%d.%03d", q$Revision: 1.9 $ =~ /: (\d+)\.(\d+)/; | |||||||||
| 9 | } | ||||||||||
| 10 | |||||||||||
| 11 | ##----- Public Class Methods ----- | ||||||||||
| 12 | 0 | ▶ | sub new { die "Unable to create instance of abstract class " . __PACKAGE__; }; | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 13 | |||||||||||
| 14 | ##----- Public Object Methods ----- | ||||||||||
| 15 | 0 | ▶ | sub execute { die "Abstract method execute() must be overridden." }; | ||||||||
|
Subroutine
execute: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 16 | 0 | ▶ | sub err_msg { my $self = shift; return $self->_getset('err_msg', @_); } | ||||||||
|
Subroutine
err_msg: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 17 | 0 | ▶ | sub clear_err_msg { return $_[0]->{err_msg} = undef; } | ||||||||
|
Subroutine
clear_err_msg: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | sub get_result { | ||||||||
|
Subroutine
get_result: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 20 | 0 | my $self = shift; | |||||||||
| 21 | |||||||||||
| 22 | 0 | my ($result) = $self->{'result'} =~ /-----MATLAB-BEGIN-----\n-----SUCCESS\n(.*)/s; | |||||||||
| 23 | # $result =~ s/EDU>> //g; ##Êremove edu prompts | ||||||||||
| 24 | # $result =~ s/>> //g; ## remove normal prompts | ||||||||||
| 25 | |||||||||||
| 26 | 0 | return $result; | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | sub fetch_result { | ||||||||
|
Subroutine
fetch_result: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 30 | 0 | my $self = shift; | |||||||||
| 31 | 0 | my $result = $self->get_result; | |||||||||
| 32 | |||||||||||
| 33 | 0 | $self->{'result'} = ''; | |||||||||
| 34 | |||||||||||
| 35 | 0 | return $result; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 0 | ▶ | sub get_raw_result { return $_[0]->{'result'}; } | ||||||||
|
Subroutine
get_raw_result: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 39 | |||||||||||
| 40 | 0 | ▶ | sub fetch_raw_result { | ||||||||
|
Subroutine
fetch_raw_result: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 41 | 0 | my $self = shift; | |||||||||
| 42 | 0 | my $result = $self->get_raw_result; | |||||||||
| 43 | |||||||||||
| 44 | 0 | $self->{'result'} = ''; | |||||||||
| 45 | |||||||||||
| 46 | 0 | return $result; | |||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | ##----- Private Object Methods ----- | ||||||||||
| 50 | 7 | ▶ | sub _getset { | ||||||||
|
Subroutine
_getset: called CC=2 SCAR=7.1
| |||||||||||
| 51 | 7 | my ($self, $field, $val) = @_; | |||||||||
| 52 | 7 | ▶ | $self->{$field} = $val if defined($val); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | 7 | return $self->{$field}; | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | 3 | 1; | |||||||||
| 57 | __END__ | ||||||||||