Alarm when exceptions are implemented in Perl

Source: Internet
Author: User

#! /Usr/bin/perl-W
Use dBi;
Use lwp: simple QW (get );

# $ Driver = "MySQL ";
$ DBH = DBI-> connect ("DBI: mysql: csunet: localhost", "root", "") | die "can not connect database ";

# Date of Generation
$ Year = (gmtime time) [5] + 1900;
$ Month = (gmtime time) [4] + 1;
$ Date = (gmtime time) [3];
$ Today = $ year. "-". $ month. "-". $ date;

$ SQL = "Select phone from duty_info where riqi = '". $ today ."'";

$…… = $ DBH-> prepare ($ SQL) | die "occur an error when query database! ";
$ Something-> execute ();
$ Numrows = $ something-> rows;

While (@ ROW = $ th-> fetchrow_array)
{
$ Number = $ row [0];
}

If ($ numrows = 1)
{
My $ url = 'HTTP: // 202.197.54.130: 9999/cgi-bin/csend.exe? N = 13687363993, '. $ number.' & M = provincial network 7206 router fault check ';
My $ content = get $ URL;

Print $ content;
Print "/N ";
}

Print "the number of conditions is: $ numrows/N ";
Print $ today;
Print "/N ";
Print $ SQL;
Print "/N ";

$ Something-> finish ();
$ DBH-> disconnect ();

Exit 0;

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.