summaryrefslogtreecommitdiffstats
path: root/MDK
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-05 06:22:26 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-05 06:22:26 +0000
commit811d1e0b1feec8f2608020c216bff09ae9fb98ca (patch)
tree02e64312cb33829681e7ec092316a3df46fd70f3 /MDK
parent2c3aeda9e08294259d8dc73f894d2afc1342de94 (diff)
downloadperl-MDK-Common-811d1e0b1feec8f2608020c216bff09ae9fb98ca.tar
perl-MDK-Common-811d1e0b1feec8f2608020c216bff09ae9fb98ca.tar.gz
perl-MDK-Common-811d1e0b1feec8f2608020c216bff09ae9fb98ca.tar.bz2
perl-MDK-Common-811d1e0b1feec8f2608020c216bff09ae9fb98ca.tar.xz
perl-MDK-Common-811d1e0b1feec8f2608020c216bff09ae9fb98ca.zip
- more perlish behaviour for to_int() and to_float()
(skipping leading spaces)
Diffstat (limited to 'MDK')
-rw-r--r--MDK/Common.pm.pl2
-rw-r--r--MDK/Common/Various.pm4
2 files changed, 3 insertions, 3 deletions
diff --git a/MDK/Common.pm.pl b/MDK/Common.pm.pl
index fea6a8f..2ac0e37 100644
--- a/MDK/Common.pm.pl
+++ b/MDK/Common.pm.pl
@@ -74,7 +74,7 @@ use vars qw(@ISA @EXPORT $VERSION); #);
# perl_checker: RE-EXPORT-ALL
@EXPORT = map { @$_ } map { values %{'MDK::Common::' . $_ . 'EXPORT_TAGS'} } grep { /::$/ } keys %MDK::Common::;
-$VERSION = "1.1.13";
+$VERSION = "1.1.14";
1;
EOF
diff --git a/MDK/Common/Various.pm b/MDK/Common/Various.pm
index eba2faf..7072aad 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] =~ /\s*(\d*)/ && $1 }
+sub to_float { $_[0] =~ /\s*(\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 }