| 1 | |||||||||||
| 2 | ########################################################################### | ||||||||||
| 3 | # Copyright (c) Nate Wiger http://nateware.com. All Rights Reserved. | ||||||||||
| 4 | # Please visit http://formbuilder.org for tutorials, support, and examples. | ||||||||||
| 5 | ########################################################################### | ||||||||||
| 6 | |||||||||||
| 7 | package CGI::FormBuilder::Messages::base; | ||||||||||
| 8 | |||||||||||
| 9 | 10 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 10 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 10 | our $VERSION = '3.10'; | |||||||||
| 13 | 10 | our %MESSAGES = (); | |||||||||
| 14 | |||||||||||
| 15 | sub define_messages { | ||||||||||
| 16 | 10 | ▶ | my $class = shift; | ||||||||
|
Subroutine
define_messages: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||
| 17 | 10 | ▶ | my %hash = ref($_[0]) eq 'HASH' ? %{$_[0]} : @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 10 | ▶ | while(my($k,$v) = each %hash) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 400 | $MESSAGES{$k} = $v; # support inheritance | |||||||||
| 20 | } | ||||||||||
| 21 | { | ||||||||||
| 22 | 10 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 10 | ▶ | while(my($k,$v) = each %MESSAGES) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 400 | ▶ | *{$k} = sub { $v }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=0.4
| |||||||||||
| 25 | } | ||||||||||
| 26 | } | ||||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | # This method should remain unchanged | ||||||||||
| 30 | sub messages { | ||||||||||
| 31 | 125 | ▶ | return wantarray ? %MESSAGES : \%MESSAGES; | ||||||||
|
Subroutine
messages: called CC=2 SCAR=7.6
Pod
undocumented
Branch: 1 branch
| |||||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 10 | 1; | |||||||||
| 35 | __END__ | ||||||||||