1 shell echo command will automatically add line breaks
2. $? Accept exit return values
3. The variable is equal to 'execute script', and the obtained value of the variable is the value output from the script to stdout.
Example:
1. Perl
Log scrolling to get information in tail-F. If "too has open files" exists, restart Apache.
#! /Usr/bin/perlmy $ now = localtime (time); & write_log ("$ now start reahache. PL \ n ". '----------------------------------'. "\ n"); open tail,
ArticleDirectory
Refer:Http://www.willmaster.com/library/manage-forms/using_perl_to_submit_a_form.php
Http://www.oschina.net/code/snippet_12_854
Sometimes you need to call the existing CGI interactively in Perl to
Redirects standard output and error output to the corresponding log file for any function.
Record the function running time for any function.
Code:
#
! /Usr/bin/perl
Use Warnings;
Use Strict;
No Strict
"
Refs
" ;
Sub
1. The use strict command means that all variables must be declared using my, and bare words must be enclosed in quotation marks.
2. Check the installed module: perldoc perllocal
Manual module installation:
Code highlighting produced by Actipro
Perl does not have various variable types like C/C ++. The variable type in Perl is determined by context, whether it is a string or an integer variable. For example, my $ para = @ _ # indicates the scalar context. $ para obtains the number of
In the lab for FPGA development, we often use OpenGL. The code specification becomes a problem. As a result, we have written a Perl script to normalize the code, mainly for automatic indentation and alignment.
The Code principle is very simple. It
System: Windows
Language: Perl
Tool: notepad ++/CMD
Currently, Perl is used to analyze the page. Then, the group downloads the files and renames them.
First, the rarfile is connected to the second-level file. The rarfile name is a number, and the
1. System ("command ");Use this command to enable a sub-process to execute the command in quotation marks. The parent process will wait until the sub-process ends and continue to execute the following code.
2. Exec ("Command ");The effect is
By default, \ n is often used as the line break.
When reading a sequence by row, it is based on a line break.
The content of the read strawberry1.gb file is as follows:LOCUS JX118024 460 bp DNA linear PLN 25-SEP-2012DEFINITION Fragaria vesca subsp.
Copy codeThe Code is as follows :#! /Usr/bin/perl
# Use strict;
Open (FILE1, "C:/Perl/BX/BX-Users.csv ");
Open (FILE2, "C:/Perl/BX/BX-Books.csv ");
Open (FILE3, "C:/Perl/BX/BX-Book-Ratings.csv ");
Open (result1, "> C:/Perl/BX/BX-Users.txt
My first perl script for the production environment, although not very good, has also taken a solid stepThe leader has a task to send a batch of IP addresses to the list and ping each machine. If no response is received, an email notification is
1. Perl "glue", which can combine various applications or code in various languages.Perl can write common scripts, cgi Modules can be used to write Web applications, and DBI can be used to access various databases.In addition, Perl can stick
So that some characters (especially wide characters) cannot be correctly displayed, that is, they are no longer in UTF-8 format.
Solution:When the output file is opened, the encoding format is specified, so no garbled characters will occur after
The Perl script batchReplace. pl can be used to replace text/code in files in batches. You can search for files of the specified type in the specified directory and recursively check the subdirectories. Copy the directory structure of the input file
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.