Perl Subroutine Sub_ Basics Tutorial

I. Definition A subroutine is a separate piece of code that performs a special task, which makes it easy to reduce duplicate code and make the program readable. In Perl, subroutines can appear anywhere in the program. The method is defined as: Sub

The format output of Perl and the importance analysis of Chomp _perl

Copy Code code as follows: #!/bin/perl Print "Please input some lines,then press ctrl+z. \ n"; Chomp (@s=); Print "1234567890" x 3. \ n "; #做为输出结果的一个标尺 foreach $s (@s) { printf "%20s\n", $s #输出的格式为右对齐, 20 characters in space }

Introduction to Perl's CGI advanced programming _perl

Method in a cgi.pm (routines) call 1. CGI.PM implements two methods of use, namely object-oriented approach and traditional Perlmodule method.Object-oriented approach: Copy Code code as follows: #!/usr/local/bin/perl-w Use CGI; #

Perl's Logwrapper Use instance code _perl

Here for you to give two small examples for friends to learn a reference. Record the time that the function was run on any function. Copy Code code as follows: #!/usr/bin/perl Use warnings; Use strict; No strict "refs"; Sub

Several ways to remove an array element from Perl summary _perl

1. Using the grep functionFunction name grep Call Syntax @foundlist = grep (pattern, @searchlist); Explanation similar to the UNIX lookup tool with the same name, the grep function extracts the element in the list that matches the specified pattern,

Perl Language History

The Perl programming language has a history of more than 26 years. December 18, 1987 Larry Wall introduced the Perl programming language, and the first post to quote the language was in 88 January, from Google's discussion group: Perl, a

Automate management of virtualized environments with Perl

Overview Virtualization, as the foundation of cloud computing, is an important trend at present. Virtualization can improve the efficiency and availability of IT resources and applications. The kernel based virtual machine KVM was RedHat acquired

Perl here Document

When using echo to output a file, if the file has double quotes, you need to use [code lang= "Perl"]echo ' Yourtext '; [/code] (enclosed in single quotation marks) questions about Perl here Document: [Code lang= "Perl"] print >> END; YOUR TEXT here

Perl slices (arrays and hashes) two

Slice usage to fetch arrays in arrays and hashes in arrays of valuesMy @array = QW (aa bb cc dd), my @select = @array [1,3];p rint "@select \ n"; # #输出bb dd123456Hash valueMy%hash = ("a" = = 1, "b" = 2, "c" = 3, "D" = 4,); my @select = @hash {QW (a

Length and number of elements in Perl arrays

The length of the Perl array and the number of elements $ #数组名---represents the subscript of the last element in the array, which equals the number of elements minus 1. The @ array name---Represents the number of elements in the array. $ scalar

Common Perl Functions

Common Perl Functions Command: PrintSyntax: Print filehandle listNote: This filehandle can be seen as a bridge between I (input) and O (output). You can use filehandle to read and write data. stdin indicates the connection from which data is input,

Perl-07-array

1. Length of the array: If you assign an array variable to a scalar variable, the length of the array is assigned to the scalar variable: $ A = @ array; # The length of the array @ array is stored in the scalar variable $ A, that is, the number of

Special variable $ _ in Perl _

$ _ This special variable is the default parameter of many Perl functions and is also the default control variable of many Perl control structures. $ _ special variables can also be used as missing parameters for function calls. The control variable

Perl sends emails (with attachments)

As a software developer, sometimes some processes on the server need to be monitored to understand the running status of the server. Therefore, when an exception occurs, the email prompt is a good choice, which enables developers to perform

Gethostbyaddr (Perl)

Gethostbyaddr (Perl)   Gethostbyaddr ADDR, addrtype   This function converts an address to a name (or modifies an address ). ADDR should be the binary network address of a packet, while addrtype should actually be af_inet (from the socket module ).

Perl uses parameters to pass URL for HTML Parsing

#! C:/perl64/bin/perlRequire lwp: useragent; My $ UA = lwp: useragent-> new;$ UA-> timeout (10 );$ UA-> env_proxy; My ($ url_new, $ url_old) = @ argv;My $ response = $ UA-> get ($ url_new );Die $ response-> status_line unless ($ response->

Use Perl to query the home location of the mobile phone number

      Sometimes you will receive an anonymous phone number that is "immediately hung up after the phone call". Sometimes you don't pay attention to it. There are several "missed phone calls" on

Use Perl configuration in Genesis)

Document directory 2007-03-22 Use the Perl configuration 2007-03-22tag in Genesis: Copyright Disclaimer: During reprinting, please use hyperlinks to indicate the original source and author information of the article and this

Some Problems about passing arrays and references in Perl function parameters

Today, I saw an article about passing references in parameters. I mentioned a problem. I have encountered it before, but I used other methods to bypass it. You can solve this problem by passing parameter references. So I plan to write it down. Hope

Perl use vars pragma usage tips

Vars in perl is a pragma (precompiled indicator) in perl that is used to predefine global variables. These predefined global variables are in the qw () list, it can be used in the entire referenced perl file. Even if you use strict, no error is

Total Pages: 66 1 .... 28 29 30 31 32 .... 66 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.