Johnny Five Toes has asked for the wisdom of the Perl Monks concerning the following question:
$filename = "myfile"; print "\nThis program uses a real expression found on http://www.regul +ar-expressions.info/unicode.html#category"; open( my $fh, '< :encoding(UTF-8)', $filename ) or die "Cannot open $f +ilename: $!"; while ( my $line = <$fh> ) { if ( $line =~ /\p{Unassigned}+/ ) { print "$line\n"; } } print "\nThis program uses a real expression found on http://www.regul +ar-expressions.info/unicode.html#category"; close $fh;
The line " if ( $line =~ /\p{Unassigned}+/ ) {" seems to be the culprit. When I replace the category expression with any other /\p expression the program runs fine. Is there extra code needed for the unassigned category?
Remember you are working with a newbie. Any help appreciate.
John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unassigned utf8
by ikegami (Patriarch) on Jun 11, 2015 at 18:39 UTC | |
|
Re: unassigned utf8
by stevieb (Canon) on Jun 11, 2015 at 17:01 UTC |