summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MDK/Common/Various.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/MDK/Common/Various.pm b/MDK/Common/Various.pm
index 2abbb14..548aed3 100644
--- a/MDK/Common/Various.pm
+++ b/MDK/Common/Various.pm
@@ -107,8 +107,8 @@ sub second { $_[1] }
sub top { $_[-1] }
sub to_bool { $_[0] ? 1 : 0 }
-sub to_int { $_[0] =~ /(\d*)/; $1 }
-sub to_float { $_[0] =~ /(\d*(\.\d*)?)/; $1 }
+sub to_int { $_[0] =~ /(\d*)/ && $1 }
+sub to_float { $_[0] =~ /(\d*(\.\d*)?)/ && $1 }
sub bool2text { $_[0] ? "true" : "false" }
sub bool2yesno { $_[0] ? "yes" : "no" }
sub text2bool { my $t = lc($_[0]); $t eq "true" || $t eq "yes" ? 1 : 0 }