in reply to an ever-available file for opening

Dear monks, I need to test the open function.

Why? Do you think that your perl executable might forget how to do it one day? Or Friday afternoons?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: an ever-available file for opening
by Sixtease (Friar) on Jan 15, 2008 at 20:18 UTC
    A very, very good question. I need to test whether the :encoding(utf8) directive works and I feel that trying it out is more reliable than just checking the perl version.
    use strict; use warnings; print "Just Another Perl Hacker\n";

      Hm. I'm not sure that your justification stands up to scrutiny, but if you must, how about:

      my $utfData = "\x..."; open UTF, '<:encoding(utf8)', \$utfData or die 'Must be pre-5,8'; die 'Bad stuff happened' unless <UTF> eq 'Whatever you expect';

      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.