Guest User

Untitled

a guest
Jun 19th, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use LWP::UserAgent;
  3. @MyAgent::ISA = qw(LWP::UserAgent);
  4.  
  5. # set inheritance
  6. $ua = LWP::UserAgent->new;
  7. $q = 'pastie.org/2509936';;
  8. $request = HTTP::Request->new('GET', $q);
  9. $response = $ua->request($request);
  10. if ($response->is_success) {
  11. if ($response->content=~/[p{Script=Arabic}]/g) {
  12. print "found arabic";
  13. } else {
  14. print "not found";
  15. }
  16. }
  17.  
  18. use List::Util 'max';
  19. my $max_ord = max map{ord}split //, $response->content;
  20. print "max ord of response content is $max_ordn";
  21.  
  22. use Encode;
  23. my $content = decode('utf-8', $response->content);
  24. # now check $content =~ /p{Arabic}/
Advertisement
Add Comment
Please, Sign In to add comment