Why is this program valid? I was trying to create a syntax error

Perl has a syntax called “indirect method notation”. It allows Foo->new($bar) to be written as new Foo $bar So that means Syntax error ! exit 0; is the same as error->Syntax(! exit 0); or error->Syntax(!exit(0)); Not only is it valid syntax, it doesn’t result in a run-time error because the first thing executed is exit(0).

Why does modern Perl avoid UTF-8 by default?

𝙎𝙞𝙢𝙥𝙡𝙚𝙨𝙩 ℞: 𝟕 𝘿𝙞𝙨𝙘𝙧𝙚𝙩𝙚 𝙍𝙚𝙘𝙤𝙢𝙢𝙚𝙣𝙙𝙖𝙩𝙞𝙤𝙣𝙨 Set your PERL_UNICODE envariable to AS. This makes all Perl scripts decode @ARGV as UTF‑8 strings, and sets the encoding of all three of stdin, stdout, and stderr to UTF‑8. Both these are global effects, not lexical ones. At the top of your source file (program, module, library, dohickey), prominently … Read more

How to fix a locale setting warning from Perl

Here is how to solve it on Mac OS X v10.7 (Lion) or Cygwin (Windows 10): Add the following lines to your bashrc or bash_profile file on the host machine: # Setting for the new UTF-8 terminal support in Lion export LC_CTYPE=en_US.UTF-8 export LC_ALL=en_US.UTF-8 If you are using Z shell (zsh), edit file zshrc: # Setting for … Read more

tech