in reply to Re^3: 'use' inside or outside of package declaration?
in thread 'use' inside or outside of package declaration?

I'll study that some more later in the day.

use strict is redundant since 5.12 includes that.

As for file names, don't forget Windows uses UTF-16 in its API. The characters has well-defined meanings (not just bytes), but it still suffers from Normalization issues.

binmode(DATA, ":utf8"); That's not implied by the utf8 pragma?

Replies are listed 'Best First'.
Re^5: 'use' inside or outside of package declaration?
by tchrist (Pilgrim) on May 12, 2011 at 12:45 UTC
    I put the strict there even when using 5.12 or above because it documents what’s going on, and because I alas find myself downgrading to 5.10.1 now and again, and don’t want to lose things.

    In general, I’m for several reasons opposed to non‐pragmas diddling their caller’s scope’s lexical hints in non‐obvious ways unrelated to that module’s purpose; that’s just too Acme:: for my tastes. But I do consider use 5.012 a pragma — that is, a compiler declaration that can alter the rules of engagement.

    And no, the necessary binmoding of DATA is triggered neither by use utf8 nor by use open ":utf8". Go figger. 😾

    I have as little to do with UTF‑16 as I possibly can. 🙈 🙉 🙊 Anything that makes me deal with individual code units is such a lose that I just want to kick the people who afflicted the world with this idiocy. Aren’t you glad we don’t have to count code units in Perl? 😹


    I see my stalker is back. Yawn!

      The big question is: Where do you get a font with a "pouting cat face?"
      Never mind, I didn’t have symbola, installed on this computer.

      What are you using to type? I see you have U+2010 HYPHEN instead of the ASCII hyphin-minus character.

      I find wide strings to be a pain in C++/Windows. I suppose it was a good idea at the time of development of NT 3, since UTF-8 was a footnote and not the force for good as we understand it today. Still, at some point they could have made the "code page" for UTF-8 (which is defined) work correctly for the 8-bit char API functions. For all I know it should: it just wraps the native calls around a call to convert, and the convert function handles that one, right?

        The big question is: Where do you get a font with a "pouting cat face?"
        Never mind, I didn’t have
        symbola, installed on this computer.
        Yeah, Symbola is great, isn’t it? Perl 5.14 and Unicode 6.0 come to the aid of the e‐emotionally challenged:
        % unifmt -22 < emotica
        😢 😔 😐 🌟 🐲 😽 👲 🗽 🐷 😚 😃
        👿 💀 🌞 ⚇ 🙅 👶 👰 👵 🎭 ☺ 🐺
        ☤ 👺 😱 👀 😌 😉 😳 👯 🌜 🐶 👨
        😰 😞 👽 😂 😜 😪 😶 😁 ☃ ☻ 😾
        🐸 👷 😡 ⚉ 😘 💩 👴 😣 🐻 🐮 👳
        🐹 😻 😍 😏 🐴 🌝 😒 𐈿 🐪 🎅 🐾
        ☹ 🐭 💃 👼 😥 😠 😩 ⚜ 😖 👦 😵
        🐼 😝 🌛 👱 👩 🐯 😭 👮 💆 😆 😅
        😤 😺 😼 🐰 👸 👾 😊 ⚛ 😫 😲 👻
        😋 😈 👹 🐧 😇 😸 😎 😨 😓 😹 👧
        😷 🌚 🎃 ⚚ 🐵 🙀 👅 🙆 🐱 😄 〠
        Those aren’t just emotica: they’re emotiquísima! With 11 rows of 11 of them, may you never again lack the right emoticon. 😋
        What are you using to type? I see you have U+2010 HYPHEN instead of the ASCII hyphin-minus character.
        Why, my fingers, of course! What are you using to type? 😜