Perl Learning 5 Hash

"Original, do not reprint without permission"A hash is a data structure that is similar to and to a group in that it can hold any number of values and can be used on demand, and that the array is indexed by numbers, and the hashes are indexed by

Perl: Input and output

Input and output: operator: Used to read data from STDIN:If you read the end of the file, the line input will return undef.$line = ; #读取下一行.Chomp ($line =); #去掉输入的一行的最后的换行符while () {print "$_";}foreach () {print "$_";}print function: used to output

Perl: Regular Expressions

Regular Expressions:The regular expression in Perl is called a pattern, which is a template that matches a string.Perl's regular expressions are similar to Shell/awk/sed/grep.m/pattern/Operation pattern Matching:/pattern/is the shorthand of

A Easy Example-to-tell-you-are "2>&1" in Perl

You can decide if make the output shown on command screens by using 2>&1 or NULTesting script:print "without null \ n";System ("dir 2>&1");print "with null \ n";System ("dir > NUL");print "End \ n";Result:C:\rebecca\script\perl\unicode>perl

Perl Learning Notes

1. Arrays#!/usr/bin/perlmy $str="Hello,nihao,no,o,good";my @arr=Split(/,/,$str);Print "Len:".@arr."\ n"; for(my $i=0;$i@arr;$i++){ #parentheses must have Print @arr[$i] ."\ n";}#!/usr/bin/perl@ifs =qw (eth1 eth2.45 eth3);$it =grep/eth2$/, @ifs;if

Perl recursively iterates through the files in the directory

#!/usr/bin/perl-w UseStrict; UseFile::Spec;Local$\ ="\ n";#each line of output of the current module adds a newline charactermy %options;#directory path$options{Single_case} ='/home/jiangyu/src/pl/example'; my @cases; if(-D$options{single_case})

Research on Perl data type security

0x00 backgroundA few days ago someone told a conference about a problem that existed in Perl for 20 years. It's really heartbreaking to be a person who will only Perl without Python. After watching the video feel black to eat nothing.This is like a

Perl uses grep map to calculate the instance code of intersection, union, and supplement

CopyCodeThe Code is as follows :#! /Usr/bin/perl # # Use grep map to obtain the Intersection Set and supplement set of the two lists # Use strict; My @ A = ("A", "B", "C", "D", "E "); My @ B = ("B", "g", "F", "E "); Print "list a data: @ A \

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

Perl-CGI advanced

A routines method in CGI. PM calls 1. cgi. PM to implement two usage methods: Object-oriented method and traditional perlmodule method. Object-oriented Method :#! /Usr/local/bin/perl-W use CGI; # Load CGI routines $ q = CGI-> New; # create new CGI

Perl basic Memorandum

1. Perl array (1): 1) initialize the array @ array = ("stringa", "stringb", "stringc "); 2) Print $ array [-1]; # output the stringc with the index (-1 + 3) % 3 = 2 3) dynamic growth $ array [4] = "stringd"; # Although $ array [3] is not used

Perl learning notes 13 objective operations

1. Change the Directory Chdir "/etc" or die "can't chdir to '/etc '! \ N "; If the parameter is omitted, the system returns to the user's home directory, which is the same as that of CD; 2. wildcard file name My @ all_files = glob "*"; # files

Perl file operations

In Perl, you can use the open or sysopen functions to open files and perform operations. Both functions use a file handle (that is, a file pointer) to read and write files. The open function is used as an example: 1. Open and Close files The return

Summary of the top500 statistical process (Perl, Shell, Java) [1-shell]

This task counts the top 500 entries in a week. Data source: from the Oracle database. Requirement: generate an Excel file and send an email to the relevant person. Because it was the first time that I was engaged in such a task (writing scripts on

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

Memory release in Perl

Recently, we have been struggling with the issue of how to release memory in Perl. Below are a few simple statements: 1. Perl-e 'for $ I (1 .. 10000) {$ hash {$ I} = 0; print "$ I \ t $ hash {$ I} \ n"; Delete $ hash {$ I };} for $ J (10001 .. 20000

ABC Perl programing-2gua short message returned

Sorry, I saw the email in Gmail and then replied to the email directly. Then ...... "This is an automatic notification email. do not reply to this email directly ." Er ...... Paste it here.   Yes. What I am sending now is what I have. This part is

Summary of perl Debugging commands

The default Perl debugger is the perl interpreter, and a GUI debugger.Generally, telnet is used to access the server during development. This document describes the usage of the default command line debugger. Start the Perl interpreter with the-d

Solve the timeout problem in the script [shell, perl, ssh]

Sometimes we execute a script, because some programs in the script are suspended and time-out, which affects our judgment on the next step. At will, it is necessary to set the timeout settings for functions and processes so that they can return a

How to configure apache to run the Perl CGI program

Apache and CGI are not explained here.1. apache download address: http://www.apache.org, the following uses 2.0.63 as an example to introduce the configuration of running CGI program.2. Download the Perl interpreter ActivePerl in Windows. Official

Total Pages: 66 1 .... 29 30 31 32 33 .... 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.