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
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";
Always do not pay attention to their own blog, the last lost just love dearly, now pay attention to it, decided to regularly back up the SQL. Write a small script as follows:
Copy Code code as follows:
#!/usr/bin/perl
Use warnings;
Use
The module uses a Perl array to represent a file, each row of the file corresponds to an element of the array, the first behavior element 0, the second back is 1, ...The file itself is not actually loaded into memory, and the operation of the array
This allows some characters (especially wide characters) to be displayed incorrectly, which is no longer utf-8 format.
Solution:When you open the output file, you specify the encoding format, and there is no garbled situation after the output file
#!/usr/bin/perl-wUse net::ftp;Use strict;My $server = ' IP address ';My $user = ' user name ';My $pw = ' password ';
My $ftp = Net::ftp->new ($server);
$ftp->login ($user, $PW) or die "login failed!/n";Print "Login ok! Starting list files on $server
Packge Mule; Use Base ("Horse", "donkey");
# Declare a superclass it is the abbreviation for the following: package Mule;
BEGIN {Our @ISA = ("Horse", "donkey"); require Horse; require donkey;}
Horse class: [root@wx03 test]# cat horse.pm package
The existing file Test.txt, the content is: "123\n456"1, Open Text test.txt#!/usr/bin/perlOpen D, "test.txt";D is the file handle, pointing to the open file2, read text line by row Test.txt#!/usr/bin/perlOpen D, "while () {Print $_;}Close D;Results:
-- Start
Perl is a very loose language. By default, we use an undefined variable or perform mathematical operations on a string and a number. It does not report any errors, so when we write a Perl script, we 'd better use one of the following
#! /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 @
It is quite disgusting to use Perl for web development and debug debugging information output. Unlike PHP, it can directly echo to the page, or eclipse directly breakpoint debugging. Perl can only output the information you want to display in a
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
(1) set external tools
Select advanced> tool Configuration
Perform the following settings:
① Command line: C:/perl/bin/perl.exe "% F"
②. Working directory: % P (some people say there is a relationship between the size and I can run this
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
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 (
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
I have created a freeswitch kernel research and exchange group, 45211986. welcome to join us. In addition, we provide the SIP-based communication server and client solution to develop the SIP/IMS video client, supports access to the SIP Softswitch,
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