I am working on a script Which pings a URL and then mails the status if a failure is encountered. The script copies URLs from a text file, pings them and mails the status. For running the script every hour i am using cron.

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 $@ } } }

In reply to Can't find Unicode property definition by Appy16

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.