Perl has long been a popular text-processing tool for its inherent support for regular expressions. In this introductory article, we'll show you how to use regular expressions in your own programs to achieve more powerful text search and
#mode operand Create truncate#read #write > Yes#append >> Yes
Case 1:throw A exception if you cannot open the file:
Copy Code code as follows:
Use strict;
Use warnings;
My $filename = ' data.txt ';
Open (My $fh, ' Or die
This is a Perl script written last year, and I haven't seen Perl since years ago.
Copy Code code as follows:
#!/usr/bin/perl
Use Lwp::simple;
Open (FILE, "while () {
s/^ip1.*//g;
My @file =split (/\,|\s+/,$_);
My @file1 = "
How do I use the Perl script operating system environment variables?
Presumably a lot of friends will soon think of this particular hash variable that $env in Perl, and, yes, you can get some system variables in $env. How do I get it? For example,
The normal subscript operation in the Perl array must be familiar to everyone, not to be explained here.What this article is trying to say is that the majority of the subscript in the Perl array can be used to greatly facilitate the operation of the
Open the file with the open () function
The common ways to open files are:
Copy Code code as follows:
Open (FH, "Or die "couldn ' t open $filename for reading: $!";
The open () function usually comes with two arguments, the
Execute the perl script by installing Mod_perl in the Apache-run environment.
Install Mod_perl
The code is as follows
Copy Code
# yum-y Install Mod_perl
Use Perlrun mode to keep the Perl compiler resident in
In PERL development, system commands can usually be executed using the systems function or the ' operator ', but pay attention to alias, BG, bind, break, Builtin, CD, command, Compgen, complete, continue, Declare, dirs, Disown, Echo, enable, Eval,
XAMPP for Mac OS X is the simplest, most practical, and most complete network server solution on Mac OS X. This release includes the latest MySQL, PHP (4+5), and Perl Apache 2 servers. It is published as a MAC OS X installation package, containing
Perl language--Simple descriptionA simple explanationPerl language Full Name: Useful excerpts and report language | Morbid eclectic garbage list. The Perl name is not an abbreviation, but a retrospective.Perl language History: Larry Wall (Larry Wall)
Perl Module Net::scp::expect Batch FileWrite deployment scripts with Net::ssh::P Erl and Net::scp::expectPerl scripts for SCP distribution filesPerl SCP Operations#!/usr/bin/PerlUse net::scp::expect;my $pc _ip="192.168.233.135"; my $pc _passwd="Test"
The idea is to find all the pronunciations of the word, and then take the first letter.Code: while() { Chomp; my($head,$all) = /^(. {3})(.*)$/; $all=~ s/^\s+//; ## # Keep only the first letter of the non-sound label SubToshorter {my $str=$_[0];
Title:new ipad Installation perl support installation Nikto--2012-11-15 09:47The more the New Ipad.SSH new ipadGo to CatalogCd/tmpDownload key Filewget http://coredev.nl/cydia/coredev.pubAdd toApt-key Add Coredev.pubAdd sourceEcho ' Deb
When you do a series of operations in a directory, you may encounter a lot of trouble to create many files or modify files. So, create a new folder, and then create a new file or modify it under this folder. Suppose your code creates a new folder
1 my $dir="d:\\my_work\\temp";2 my @files= ();3 4 #gets the file in the given directory5 @files= Get_dir_files ($dir); 6 7 #gets the file under the given directory and subdirectories8 @files= Get_dir_files_x ($dir);9 Ten #gets the files under the
To study a Perl script today, several of the regular ones are very confusing: $text =~ s/([?! ]) + ([\ \ \"\ (\[\? \? \p {Ispi} ]*[\p{isupper}])/$1\ n$2/g; #Multi-dots followed by sentence starters $Text =~s/(\.[\.]+) +([\
Regular expressionsSimple mode: Matches the contents of the $_, just write the pattern in a pair of slashes (/).such as: #!/usr/bin/env PerlUse 5.010;$_= "Yabba dabba Doo";if (/abba/) {Say "it matched!";}About meta characterssimilar to the Shell :.==
Perl tutorial
Http://www.cbi.pku.edu.cn/chinese/documents/perl/index.htm
Getting started with Perl
Http://developer.51cto.com/art/201009/224638.htm
Learning Perl 1 helloworld**************************************** ******Brief Introduction:Perl is
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.