Appy16 has asked for the wisdom of the Perl Monks concerning the following question:
The file contains many URLs but i need to check only those which contain PIng before them.eg
Test File2:
Ping google.com
Ping yahoo.com
abcd.com
hello.com
Here only google.com and yahoo.com should be checked and others should not. I am trying to check the URLs containing Ping by compairing them as under but i recieve the following error :
Can't find Unicode property definition "i" at test12.pl line 21, <$fh> line 6.
What does this error mean and What am I doing wrong?? Kindly Help. Thanx in advance.#!/usr/bin/perl use warnings; use LWP::Simple; use Email::Send; use Email::Send::Gmail; use Email::MIME::Creator; use Net::Ping::External qw(ping); use Tie::File; my $testfolder = "/Users/Appy/Desktop/"; my $to = "test1\@gmail.com"; my $from = "appy.test1\@gmail.com"; my $subject = "URLs not responding."; tie @file, 'Tie::File', $testfolder . "testfile2.txt" or die; foreach $URL (@file) { my $string1 = $URL; if ($string1 =~ m/ # Match \ping\s # 'Ping ' /ix # i = Ignore case # x = allow the regexp to go over multiple + lines ) { print "$URL\n"; my $alive = ping(host => "$URL"); if ($alive) { print "$URL is active.\n"; } else { print "$URL is inactive\n";my $email = Email::MIME->create( header => [ From => $from, To => $to, Subject => $subject, ], body => "$URL is not working" ); my $sender = Email::Send->new( { mailer => 'Gmail', mailer_args => [ username => 'test12@gmail.com', password => '1234qwerty', ] } ); eval { $sender->send($email) }; die "Error sending email: $@" if $@ } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't find Unicode property definition
by Corion (Patriarch) on Mar 23, 2010 at 08:54 UTC | |
by Appy16 (Sexton) on Mar 23, 2010 at 09:21 UTC | |
by moritz (Cardinal) on Mar 23, 2010 at 09:24 UTC | |
by pemungkah (Priest) on Mar 23, 2010 at 09:27 UTC | |
|
Re: Can't find Unicode property definition
by Anonymous Monk on Mar 23, 2010 at 09:34 UTC |