Perl capture and Warehousing script sharing _perl

#!/usr/bin/perl-w use DBI; Use POSIX QW (strftime); My $dbh = Dbi->connect ("Dbi:mysql:shencan:111.1.32.153:3306″", "Shencan", "Shencan"); #my $sql = "SELECT * from Shencan. LVS "; #my $sth = $dbh->prepare ($sql); # $sth->execute (); My $HOSTNAME = '

Example of Perl lookup process PID _perl

The main use is to find the related files in the/proc directory. #!/usr/bin/perl use strict; Use warnings; #usage: process_grep.pl processname exit (Main (@ARGV)); Sub Main {my $Phash; my $ProcessName = shift; My $PROC _dir = "/proc";

Perl script detects whether a domain name is valid _perl

Scripting function: To detect the specified domain name by using ICMP ping or Tcp/syn to detect the validity of the domain name before probing. file:check.host.pl #!/usr/bin/perl use strict; Use Net::P ing; Use Net::D ns; Use Time::hires qw ();

Perl Advanced Sort,<=> operator, spaceship operator _perl

Sort by Requirement: Copy Code code as follows: #!/bin/perl @number =QW/5 10 15 3 2 4 8 6/;My @descending =sort {$a $b} @number; #这里 $a = 10, because $a was previously, the result of Perl was decimal in the previous, or ascending order.

The array or hash is empty in Perl

There is no bool type in PerlThere is no bool type in Perl, and all judgments are made by numeric types and string types.What type is FalseThere are only three scalars, the number 0, the empty string "", and the string ' 0 ' ("0").The vector has an

Perl Object-oriented processing JSON data and Rest API in Perl

Requirements : Some of the RESTful APIs have been implemented to remove the value of some key from the return value of the RESTful API by invoking the RESTful API.1) in rest, each object is a 1 URL;Here you need to know how Perl sends the request

Perl calls to Weka

1. Configure Weka environment variables;2. Write Perl, as follows:########################################################################################################### ################### #!/usr/bin/perlUse strict;Use warnings;open FILE,

Perl Learning 8 processing Text with Regular Expression

Replace with s/// : If you think of m// pattern matching (pattern match) as the word processor's "find" function, then The s/// replace (substitution) operator is the "Find and replace" function. This operator simply replaces the part of the

Perl Learning Notes (iv)--subroutines

To define a sub-program :To define your own subroutine, you can use the keyword sub, the subroutine name (not including the number), and the block of code enclosed in curly braces, for example:1 Sub marine{2 $n + =1; # global variable $n 3

The argument of Perl learning

Arguments is the values you pass to a Perl script. Each value on the command line after the name of the script is assigned to the special variables$ARGV [0], $ARGV [1], $ARGV [2], and so on. The number of arguments passed to the script

Perl string processing Memorandum

1. Chop and chomp Functions Both functions use strings as parameters and remove the last character from them. The difference is that, no matter what the last character is, chop will be removed and returned in the return value. Only when the last

Perl uses file locks to run a single script instance

Original article address:Http://blogread.cn/it/article/743? F = WB   I used Perl to write some monitoring scripts and put them in crontab for scheduling and execution. Sometimes you will find that a script runs for too long and starts multiple

Method for directly generating documents from Perl code

Perl supports generating documents from text blocks in your pod format. This pod text block can be embedded in CodeOr a separate file. With the pod, It is very convenient to write a script without having to write additional documents. We

Perl file read/write details

1. Open and Close files The syntax is open (filevar, filename), where filevar is the file handle, or is Program Is used to represent the code of a file. filename is the file name, and its path can be relative or absolute. Open (file1, "file1

Perl control structure condition control if while

I. Condition Determination If ( ){ } Elsif ( ){ } ... Else { } Ii. Loop: 1. While Loop While ( ){ } 2. Until Loop Until ( ){ } 3. For Loop of class C, such For ($ COUNT = 1; $ count # Statements inside the loop go here } The following is an

Regular Expression Processing for HTML instances (Perl implementation)

1. Tag extraction in HTML ])*> 2. Extract the URL and link text in the label. While ($ html = ~ M {A \ B ([^>] +)> (.*?) }ig) {my $ guts = $1; my $ link = $2; if ($ guts = ~ M {\ B href # href attribute \ s * = \ s * # A blank character (? : #

Perl Lite version netstat

Writing intention:The built-in netstat in Linux system often finds that CPU consumption is high when capturing information, especially when some monitoring systems are used,It is found that if netstat is used, the monitoring system itself will cause

Reference basic in Perl

Making references References can be created in several ways. By using the backslash operator on a variable, subroutine, or value. (This works much like the & (address-of) Operator in C.) This typically createsAnotherReference to a variable, because

Explore the Perl world (updated to Chapter 57)

I am very grateful to superor for taking his own time and providing the first Chinese video tutorial for the Chinese Perl community. It is a good tutorial in other languages. Compared with Perl, Perl is still relatively small. It is quite convenient

How to generate exe for your PERL script ?, Generateperl

How to generate exe for your PERL script ?, Generateperl The way I am using is PAR Packer.   1. Downloadmodule PAR Packer: Http://search.cpan.org /~ Rschupp/pars-packer-1.024/lib/PAR/Packer. pm 2. InstallPAR Packer: 2.1Unzipthe *. tar 2.2Go tothe

Total Pages: 66 1 .... 34 35 36 37 38 .... 66 Go to: GO

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.