Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: A locale independent sprintf?

by salva (Canon)
on Jul 29, 2020 at 08:58 UTC ( [id://11119948]=note: print w/replies, xml ) Need Help??


in reply to Re^2: A locale independent sprintf?
in thread A locale independent sprintf?

The no locale pragma does not change the locale, it just deactivates it.

Actually, if you look at the code, you will see it disables the internal hint that tells perl builtins to honor the locale configuration. I am sure doing that is completely thread safe.

Replies are listed 'Best First'.
Re^4: A locale independent sprintf?
by swl (Parson) on Jul 29, 2020 at 11:27 UTC

    Very handy. When applied at the package scope it will also allow code to avoid locale based effects across subs (i.e. more than just sprintf).

      Unless you are putting your packages in blocks, locale does not exist in package scope — it is a lexical pragma, just like strict and warnings. So no locale at file scope will inhibit locale effects for everything after it in the same file, unless countermanded with use locale.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11119948]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2024-04-19 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found