Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use LWP::UserAgent;
- @MyAgent::ISA = qw(LWP::UserAgent);
- # set inheritance
- $ua = LWP::UserAgent->new;
- $q = 'pastie.org/2509936';;
- $request = HTTP::Request->new('GET', $q);
- $response = $ua->request($request);
- if ($response->is_success) {
- if ($response->content=~/[p{Script=Arabic}]/g) {
- print "found arabic";
- } else {
- print "not found";
- }
- }
- use List::Util 'max';
- my $max_ord = max map{ord}split //, $response->content;
- print "max ord of response content is $max_ordn";
- use Encode;
- my $content = decode('utf-8', $response->content);
- # now check $content =~ /p{Arabic}/
Advertisement
Add Comment
Please, Sign In to add comment