johayek has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Monks,

I quite like using the combination of Getopt::ArgvFile and Getopt::Long,
have employed it for years now and then.

But it's 2015, and nowadays you do not want any longer to restrict yourself to the the trivial subset of printable 7-bit-ascii characters in files loaded by Getopt::ArgvFile,
esp. for option values;
but Getopt::ArgvFile does not appear Unicode-ready to me.

Question is wheater is worth investing the effort making it Unicode-ready.

Is there anything like Getopt::ArgvFile around? and Unicode-ready?

Should I read a file myself into an array
and then process it using GetOptionsFromArray?

Kind regards,
~J

  • Comment on Getopt::ArgvFile + Getopt::Long -- but how to specify the encoding?

Replies are listed 'Best First'.
Re: Getopt::ArgvFile + Getopt::Long -- but how to specify the encoding?
by Anonymous Monk on Mar 17, 2015 at 23:40 UTC

    Question is wheater is worth investing the effort making it Unicode-ready.

    Do you want to use it? Do you have a minute? Then its worth the effort

    As far as i can see, all you do is change

    # open file and read its contents open(OPT, $arrayRef->[$i]);
    so it specifies encoding somehow ... maybe '<:via(File::BOM)' or some such

    Then the real work of writing tests that check this works and doesn't break...

    perlunitut: Unicode in Perl