elsif (s/^( $fqtyrex ) \s* t \s+ //xo) { $def->(0, $1 * 1000.0 ); }
elsif (s/^( $fqtyrex ) \s* l \s+ //xo) { $def->(1, $1 ); }
elsif (s/^( $fqtyrex ) \s* kl \s+ //xo) { $def->(1, $1 * 1000.0 ); }
- elsif (s/^( $iqtyrex ) \s* ([a-z ]+) \s+ //xo) {
+ elsif (s/^( $iqtyrex ) \s* ([a-z ]+) \s+ //ixo) {
my ($qty,$spec) = ($1,$2);
$debugf->("VALUE COMMOD $qty '$spec'");
expected_error("Capacity specification must start with".
FROM commods WHERE commodname LIKE ?");
my ($emsg,$commod,@umv)=
dbw_lookup_string($spec,$commodsth,1,0,0,
- "No commodity or unit matches \`$spec'",
- "Ambiguous commodity (or unit) \`$spec'",
- undef);
+ "No commodity or unit matches ".escerrq($spec),
+ "Ambiguous commodity (or unit) ".escerrq($spec),
+ undef);
expected_error($emsg) if defined $emsg;
$debugf->("VALUE COMMOD FOUND '$commod' @umv");
foreach my $mvi (0,1) {
push @canon, $commod;
} else {
s/\s+$//;
- expected_error("Did not understand value \`$_'");
+ expected_error("Did not understand value ".
+ escerrq($_));
}
}
};
$_ *= $pct / 100.0;
}
push @canon, sprintf "%g%%", $pct;
- } elsif (!m/[^a-z]/) {
+ } elsif (!m/[^a-z ]/i) {
$debugf->("TERM NAME");
- expected_error("Name (should be unit or commodity) \`$_'".
+ expected_error("Name (should be unit or commodity)".
+ escerrq($_).
" without preceding quantity")
unless $first_term;
my $sth= $dbh->prepare("SELECT name,mass,volume".
" FROM vessels WHERE name LIKE ?");
my ($emsg,$ship,@smv)=
dbw_lookup_string($_,$sth,1,1,2,
- "Ship name `$_' not understood.",
+ "Ship name ".escerrq($_)." not understood.",
"Too many matching ship types.",
- sub { "Ambiguous - could be $_[0]" });
+ sub { "Ambiguous - could be $_[1]" });
expected_error($emsg) if defined $emsg;
$debugf->("TERM NAME SHIP '$ship' @smv");
$show_answer= 1;
$first_term= 0;
};
-while ($string =~ s/^(.*?)(\bminus\b|-|\bplus\b|\+)//) {
+while ($string =~ s/^(.*?)(\bminus\b|-|\bplus\b|\+)//i) {
my ($lhs)= ($1);
my @nextsign= $2 =~ m/^p|^\+/ ? (+1,'+') : (-1,'-');
$show_answer= 1;