chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Spelling fixes etc.
[ypp-sc-tools.main.git]
/
yarrg
/
web
/
check_capitalstring
diff --git
a/yarrg/web/check_capitalstring
b/yarrg/web/check_capitalstring
index 90148c64e38598a74d7cce76a81e176ea8576d77..24617d70c32c4d195099a98015bc11a65d1bec0f 100644
(file)
--- a/
yarrg/web/check_capitalstring
+++ b/
yarrg/web/check_capitalstring
@@
-33,31
+33,30
@@
</%doc>
</%doc>
-<%attr>
-</%attr>
-
-<%method preparse>
+<%method execute>
<%args>
<%args>
-$h
+$string
+$dbh
+$debugf
</%args>
<%perl>
</%args>
<%perl>
-$_= $
{ $h->{String} }
;
+$_= $
string
;
s/^\s+//; s/\s+$//;
s/^\s+//; s/\s+$//;
-my $res= sub {
- my ($capital) = @_;
- push @{ $h->{Results} }, [ $capital ];
- ${ $h->{Canon} }= "$capital PoE";
-};
+my $capital;
+my $canon;
if (!m/\S/) {
if (!m/\S/) {
+ $canon= '';
} elsif (m/^([1-9]\d*)( PoE)?$/i) {
} elsif (m/^([1-9]\d*)( PoE)?$/i) {
- $res->( $1 );
+ $capital= $1;
+ $canon= "$capital PoE";
} else {
} else {
- ${ $h->{Emsg} }= "Cannot understand capital \`$_'.";
- return;
+ expected_error("Cannot understand capital ".escerrq($_).".");
}
}
+return ($canon,$capital);
+
</%perl>
</%method>
</%perl>
</%method>