On 19/12/14 at 7:17 AM +0100, Marek Stepanek <[email protected]> wrote:

Is the Perl guru Ronald in this group not any more? Somebody else taking
this challange?

Hehe, you are speaking with one, just one who didn't have time read everything before.

I wasn't paying attention to source of your unicode data, it's coming from STDIN, and Perl needs to be told that is also unicode; this script works:

#!/usr/bin/perl

use strict;
use warnings;
use utf8;
use open ':encoding(utf8)', ':std';

while(<>) {
    if (/😘/) {
        print "got it!\n"
    } else {
        print "nope!\n"
    };
}

exit 0;


Specifically, the following input:

blank
😘
get a space
😘
notthis
this is 😘


After running filter becomes:

nope!
got it!
nope!
got it!
nope!
got it!


So, try adding the following line at top of script:

use open ':encoding(utf8)', ':std';
--
   Charlie Garrison  <[email protected]>
   github.com/cngarrison   metacpan.org/author/CNG

O< ascii ribbon campaign - stop html mail
http://www.ietf.org/rfc/rfc1855.txt

--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].

Reply via email to