Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. sub whack {
  2. my $s = shift;
  3. return '' unless defined $s;
  4. return join(' ', map { ord $_ } split(//, $s))."\n";
  5. }
  6.  
  7. use utf8;
  8. use strict;
  9. my @i = ( 197, 160, 195, 186, 195, 161 );
  10. my $i = join('', map { chr($_) } @i);
  11. utf8::upgrade($i);
  12. die "NOT UTF8" unless utf8::is_utf8($i);
  13.  
  14. print STDERR whack($i);
  15. no bytes;
  16. if ($i =~ /([[:upper:]]+)([[:lower:][:digit:]]+)([[:upper:]]+)([[:alpha:][:digit:]]*)/) {
  17. print STDERR '$1 ' . whack($1);
  18. print STDERR '$2 ' . whack($2);
  19. print STDERR '$3 ' . whack($3);
  20. print STDERR '$4 ' . whack($4);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement