Chomp and chop are all characters used to remove the tail of a string variable, but they have their own differences.
The Chomp function works on a variable, and this variable contains a string. If there is a newline character at the end of the
The ability to manipulate dates and times is fundamental to most programming languages, and Perl is no exception. But when it comes to more complex processing of time, Perl's own features often seem powerless. In this case, it's a good idea to take
one. DataType (data type ):Perl's data types are roughly four: Scalar (variables), Scalar Array (array), hash array (hash), References (pointer), but they seem to be small but more than sufficient. In particular, you can write a Perl program without
Introduction to Perl Syntax Perl operators
1.Perl operator
1.1 Arithmetic operators
Perl is very different in variables and data paradigms and C. However, its operator and C are almost identical, except for the example conversion operator type of
First, how does Perl get
Copy Code code as follows:
#!/usr/bin/perl-w
Use POSIX QW (strftime);
My $day = strftime ("%y%m%d", LocalTime (time-24*3600)); #获取昨天的日期
Second, in Linux on the man date-d parameters of the
Perl + fastcgi + nginx Build
Nginx + fastcgi is the most popular environment in PHP, then Perl will also have fastcgi it, of course, Today to build the next Nginx Perl fastcgi. Performance is no less than PHP, but now the popularity of Web programs
Chomp is used to remove line breaks.
Copy Code code as follows:
#!/usr/bin/perl
$c = "ABCDE";
Chomp ($c);
print "$c \ n";
[Root@ak]# Perl a.pl
Abcde
Chop is used to delete the last character.
Copy Code
Example:
Copy Code code as follows:
#!/bin/perl
Print "Please input a string and a number by order!\n";
$the _string=<>;
$the _numb=<>;
Print "The result is \ n";
Print "$the _string" x "$the _numb";
Results:The
The contents of the Perl Archive Network (CPAN) of Windows-specific Perl modules can be satisfying for many people. Windows users like it because it allows users to efficiently and quickly carry out fairly complex work in a Windows development
Differences from Perl PCRE function PCRE Patterns PHP manual
Schema Syntax
(No version information available, might only being in SVN)
Schema syntax-syntax explanation for Perl compatible regular expressions
The PCRE library is a set of functions
Perl Code implementation:
#!/usr/bin/perl use
strict;
Use warnings;
Use diagnostics;
Open (LOG, ' > ', ' log_file ') or die "Can ' t redirect stdout: $!";
Open (CMD, ' ls | ');
Open (STDERR, ' >& ', STDOUT) or die "Can ' t redirect STDERR: $!";
PHP cgi|perl Shell Script Way
Why is PHP so red?
Recently, PHP (Personal hypertext preprocessor) seems to have become the most widely used web-processing language in the last two years, and its convenience, powerful features and opensource
After a Perl script that configures disk space alarms on the new Linux server (Red Hat Enterprise linux Server Release 5.7 (tikanga)), the test times follows the following error
[Oracle@db-server scripts]$./disk_capatiy_alarm.sh
Can ' t locate
! Preview· the development trend of language must be the combination of static and dynamic, flexible and economic· Perl is obscure, Python is elegant and clear, Ruby is smart, and PHP is simple· Perhaps elegance comes from the attention to detail
Perl's object-oriented is not yet introduced, so this section has nothing to say but a few things to note.In the case of a handle that used to use uppercase letters often (that is, the so-called bare-Word file handle, Bareword filehandle), you can
Manually compile the Perl Module
Advantage: all modules are available.Disadvantage: A little troubleSpecific steps: 1 install the compiler 2 set the environment variable of the compiler 3 possibly install dmakeSpecific Method:
1. First of all,
In a programming language, security risks are generally not generated when designing this language. In fact, this risk is introduced by programmers. Almost every programming language has such a vulnerability, which may cause insecure software to
Introduction to Perl Operators
1. Perl Operators
1.1 Arithmetic Operators
Perl is similar to C in both variables and data examples, but its operators and C are almost the same, except for C's example conversion operator type, pointer Reference
I. Data Types(Data type):
Perl has four data types: Scalar (variable), Scalar Array (Array), Hash Array (Hash), and References (pointer ), it seems to be rare, but it is more than enough to use it. Especially when writing Perl programs, you do not
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.