develooper Front page | perl.perl5.porters | Postings from June 2013

Re: [perl #118279] FAIL_OK is not defined in utf8

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
June 3, 2013 10:35
Subject:
Re: [perl #118279] FAIL_OK is not defined in utf8
Message ID:
20130603102948.GB30134@iabyn.com
On Mon, Jun 03, 2013 at 02:38:02AM -0700, Victor Efimov wrote:
> FAIL_OK is not defined in utf8 module, however it's mentioned in
> documentation
> 
> $ perl poc.pl
> Bareword "FAIL_OK" not allowed while "strict subs" in use at poc.pl line 5.
> Execution of poc.pl aborted due to compilation errors.
> 
> $ cat poc.pl
> use strict;
> use warnings;
> use utf8;
> my $string='123';
> utf8::downgrade($string, FAIL_OK);
> 
> it does not work as utf8::FAIL_OK too
> tested under perl 5.10 and 5.18

FAIL_OK is not a literal constant; its just a placeholder in the
documentation, which later on says "if the value of C<FAIL_OK> is
true...".

It's similar to where the docs for map say

    =item map BLOCK LIST

where you're not expected to pass the literal string 'BLOCK' as an arg.

Perhaps the docs could be improved by putting FAIL_OK in italics or
something?

-- 
O Unicef Clearasil!
Gibberish and Drivel!
    -- "Bored of the Rings"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About