code_junkie

Why do my Perl tests fail with `use encoding 'utf8'`

Nov 13th, 2011
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. #!perl
  2.  
  3. use strict;
  4. use warnings;
  5. use encoding 'utf8';
  6. use Test::More 'no_plan';
  7.  
  8. ok('áá' =~ m/á/, 'ok direct match');
  9.  
  10. my $re = qr{á};
  11. ok('áá' =~ m/$re/, 'ok qr-based match');
  12.  
  13. like('áá', $re, 'like qr-based match');
Add Comment
Please, Sign In to add comment