How to fix a locale setting warning from Perl

Your OS doesn’t know about en_US.UTF-8. You didn’t mention a specific platform, but I can reproduce your problem: % uname -a OSF1 hunter2 V5.1 2650 alpha % perl -e exit perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LC_ALL = (unset), LANG = “en_US.UTF-8” are supported and installed on your … Read more

Global symbol requires explicit package name

Have a look at perldiag: Global symbol “%s” requires explicit package name (F) You’ve said “use strict” or “use strict vars”, which indicates that all variables must either be lexically scoped (using “my” or “state”), declared beforehand using “our”, or explicitly qualified to say which package the global variable is in (using “::”).

What does “if (1)” do?

Technically, the if (1) does nothing interesting, since it’s an always-executed if-statement. One common use of an if (1) though is to wrap code you’d like to be able to quickly disable, say for debugging purposes. You can quickly change an if (1) to if (0) to disable the code.

How to decrypt hash stored by bcrypt

You’re HASHING, not ENCRYPTING! What’s the difference? The difference is that hashing is a one way function, where encryption is a two-way function. So, how do you ascertain that the password is right? Therefore, when a user submits a password, you don’t decrypt your stored hash, instead you perform the same bcrypt operation on the user input and compare … Read more