summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorDavid Golden <dagolden@cpan.org>2010-01-16 18:03:52 -0500
committerDavid Golden <dagolden@cpan.org>2010-01-16 18:03:52 -0500
commit8d08d9baca8b5e17813fd3fbfe3510d7ba6097f7 (patch)
treef31298fde9d8dabf17a3248d4f4587886c2fe763 /toke.c
parentb386fa440d8266b7c2eb26f47b6c2a7d315a0128 (diff)
downloadperl-8d08d9baca8b5e17813fd3fbfe3510d7ba6097f7.tar.gz
Parse 'use NAME VERSION' with C locale
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index 2b98ada3ae..2d383b3019 100644
--- a/toke.c
+++ b/toke.c
@@ -2093,7 +2093,13 @@ S_force_version(pTHX_ char *s, int guessing)
#endif
if (*d == ';' || isSPACE(*d) || *d == '}' || !*d) {
SV *ver;
+#ifdef USE_LOCALE_NUMERIC
+ char *loc = setlocale(LC_NUMERIC, "C");
+#endif
s = scan_num(s, &pl_yylval);
+#ifdef USE_LOCALE_NUMERIC
+ setlocale(LC_NUMERIC, loc);
+#endif
version = pl_yylval.opval;
ver = cSVOPx(version)->op_sv;
if (SvPOK(ver) && !SvNIOK(ver)) {