The Perl CGI environment variables differ depending on the server. So this content does not necessarily correspond to your Web server completely.
The following items are sorted alphabetically:
1. Auth_type
If the server supports Basic
This article mainly introduced in the EditPlus Configuration Perl Development compilation environment, the configuration is quite simple, is suitable for the small development environment, needs the friend to be possible to refer to under
1. Perl "Glue" enables the integration of code in various applications or languages.Perl can write common scripts, and you can use CGI modules to write Web applications, and you can use DBI to access various databases.In addition to this, Perl can
deleting files
Use the Unlinke function, such as unlink $file, unlink $file 1, $file 2, $file 3
Open File
Opening the file in the form of three parameters makes it easy to differentiate between the schema and the file name, which is supported by
Creating characters with code points
$alef = Chr (0x05d0);$alpha = Chr (Hex (' 03b1 '));$omega = Chr (0X03C9);
You can convert a string to a code point by using the Ord () function:$code _point = Ord ('? ');
Comparing numeric stringsEqual = =
#! /Usr/bin/perl-W use strict; Use 5.010; sub getdigit ($) {# Get digit from num my ($ num, $ flag) =@_; return $ num/(10 *** $ flag) % 10; } sub radixsort ($/@) { my ($ size, $ ARR) = @_; my @ sortarr; my $ I; my $ K; for (0 .. 3) { my @
Perl built-in variables:-01-04 are Perl built-in variables that you know. If you have any missing variables, post them to add them:
$-Number of printable lines on the current page, part of the perl format system$! Returns the error code or string
Perl read files
Open (file, "filename.txt ");
My $ record;
While ($ record = )
{
Print ("file record is: $ record/N ");
}
Close (File );
Perl file writing
Overwrite
Open (file, "> filename.txt ");
Syswrite (file, "This is My Write File
Our project has many testing platforms, including Windows and Linux. Linux provides an unzip command for decompression, but it is troublesome in windows. in Windows 2000, no command is provided to decompress the file. In XP, The unzip command is
1. Write the code and # Run the CHMOD 755 file name directly.2. debugging is also possible, # Perl-M file name3. Transfer characters only play a role in double quotation mark strings, and scalar variable interpolation is also the same4. Use a scalar
Perl is context-related and different from many other languages. The interpretation of values in Perl sometimes depends on the context of the operation or value. The context includes numbers, strings, lists, and flags. There are two common
I. File Location relocation function:
1. Rename () function: rename a file
$ Ret = Rename (oldname, newname );
This function is used to rename the old file name oldname to a new name newname, or transfer the file oldname to the specified directory
Note: This is an article on the Internet ~ (Post http://www.weskers.com/tag/debug)
Next let's go to the topic. to configure a graphical debug environment in win, you must first have a Perl (Khan, required) with environment variables.
Run the
#! /Usr/bin/perl-W use strict; Use 5.010; sub bigheapadjust ($ /@) { my ($ POs, $ Len, $ ARR) =@_; my $ temp = $ arr-> [$ POS]; # filter sons with large node values to the lower layer. 2 * r + 1 is the left son, 2 * (R + 1) yes right son for (
Address: http://blog.csdn.net/omohe/article/details/1562515
To read a string from a file using Perl, you can use either of the following methods:
1. Read all the content in the file into an array at a time (this method is suitable for small files
The source code is as follows:
C # code
[Webmethod]
Public String Hello (){Return "Hello World ";
}
Perl code 1:#! /Usr/bin/perl-W
Use strict;Use soap: lite;
Print soap: Lite-> Uri ('HTTP: // tempuri.org ')-> On_action (sub {sprintf '% S/%
Index (primary string, substring) starts from 0 and returns the position of the most recent substring in the primary string.
Rindex (Main string, sub-string) Searches from the end and returns the position of the most recent sub-string in the main
There are two good links about this topic:
Http://www.thesitewizard.com/archive/addcgitoapache.shtml http://www.thescripts.com/serveradministration/webservers/apache/virtual-hosting/app/Install_Apache_Web_Server_Perl_PHP_MySQL_on_Windows.html
Steps:
The use base is used to describe the "base class" in Object-Oriented Programming. To put it bluntly,
Use base somemodule;It is equivalent to the combination of the following two sentences:
Begin {Use somemodule ();Push @ Isa, QW (somemodule );}You
Restore Perl
Http://www.linuxsir.org/bbs/showthread.php? T = 78216
PerlFunction and scope.
Syntax:
Sub subroutinename
{
My(@ Argstosubroutine) = @ _; # The parameter is passed to the function in this way.
& Dostuff ;#Execution body
Return (@
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