| 1 | package Enbld::Target::AttributeExtension::RegEx; | ||||||||||
| 2 | |||||||||||
| 3 | 7 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 7 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 7 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 7 | ▶ | use parent qw/Enbld::Target::Attribute/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | sub validate { | ||||||||||
| 11 | 273 | ▶ | my ( $self, $string ) = @_; | ||||||||
|
Subroutine
validate: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 12 | |||||||||||
| 13 | 273 | $self->SUPER::validate( $string ); | |||||||||
| 14 | |||||||||||
| 15 | 269 | eval { "" =~ /$string/ }; | |||||||||
| 16 | |||||||||||
| 17 | 269 | ▶ | if ( $@ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 2 | my $type = ref( $self ); | |||||||||
| 19 | 2 | $type =~ s/.*:://; | |||||||||
| 20 | |||||||||||
| 21 | 2 | require Enbld::Exception; | |||||||||
| 22 | 2 | croak( Enbld::Exception->new( | |||||||||
| 23 | "Attribute '$type' is NOT valid regular expression string", | ||||||||||
| 24 | $string | ||||||||||
| 25 | ) ); | ||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 267 | return $string; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 7 | 1; | |||||||||