in reply to Re: replacement for deprecated encoding pragma
in thread replacement for deprecated encoding pragma

So, what you are saying, there is no replacement for an automatic "use encoding..." pragma whatsoever.
Perl developers deprecated it and replaced it with nothing?
  • Comment on Re^2: replacement for deprecated encoding pragma

Replies are listed 'Best First'.
Re^3: replacement for deprecated encoding pragma
by haj (Vicar) on Jul 20, 2021 at 11:44 UTC

    It is has not been replaced by nothing. What has been taken away, without replacement, is the feature to write use encoding 'ISO-8859-5'; and then use cyrillic characters in that encoding in character literals of your source code. But you didn't do that, you declared UTF-8, and there is a replacement for that: There is use utf8; which is the equivalent of use encoding 'utf8';

    Note that (precisely: Since Perl 5.8.2) neither of those affects how your program reads and writes text: They are used to declare that your source code is encoded as UTF-8. So it mostly affects string literals in your code, but not templates or anything else your program reads or prints to.

    If you want to set a default encoding, have a look at open. If you write use open ':encoding(UTF-8)'; then every calls to open within the lexical scope of the open pragma will be UTF-8 encoded.

Re^3: replacement for deprecated encoding pragma
by ikegami (Patriarch) on Jul 22, 2021 at 04:16 UTC

    Not at all. There's surely a nice way of doing of fixing the bug that you fixed by relying on another bug (i.e. by using use encoding). But you didn't give us any information about the problem. So refPrint doesn't return the right output. And?

    Seeking work! You can reach me at ikegami@adaelis.com