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 operator * ptr and layout member selector. Other C operators are almost comp
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 C, the pointer refer
Http://www.mdbbs.org/thread-28471-1-1.html This is a reference method when I learn Perl, I feel very good, share with you:
Each person has different learning methods. The following are some examples for your reference.
If Perl is the first programming language you have learned, we recommend that you first read some
Original Name: Brian's Guide to solving any Perl Problem
Moderate: Brian's omnipotent guide to Perl issuesPrepared by: Brian D FoyOriginal article: http://www252.pair.com/comdog/brian's_guide.podOutput table:Translation: KlausAudit: QiangExit: Chinese Perl Association FPC-pe
implement the same functionality. On the left is an array of @a operations, and the right-hand one is the operation of the arrays pointed to ' reference ' $aref. They have the same effect on the array.
Use the ' reference ' of the hash and the ' reference ' of the array to be exactly the same.
%h%{$href} a hashKeys%h keys%{$href} remove keys from hash$h {' Red
expressions implement the same function. On the left is the @ A operation on the array, and on the right is the operation on the array pointed to by 'quot' $ Aref. They have the same effect on arrays.
The 'quota' of the hash is exactly the same as the 'quota' of the array.
% H % {$ href} a hashKeys % H keys % {$ href} get the key from the hash$ H {'red'} $ {$ href} {'red'} is a member in the hash.$ H {'red'} = 17 $ {$ href} {'red'} = 17 assign values to a memberNo matter what you want to do wit
This article will focus on the usage of the Perl split function. A very useful function in Perl is the Perl split function, which separates strings and puts the split results into arrays. This Perl split function uses a rule expression (RE), which works on the $ _ variable if not specified.
This article focuses on the use of the Perl split function, and a very useful function in Perl is the Perl split function-dividing the string and putting the segmented result into the array. This Perl split function uses a regular expression (RE) and, if not specific, works on the $_ variable.
Sub Reference_sub{My ($i, $j) =@_ #引用也是一种特殊的数据形式, they are stored as scalar quantities in @_Print "in subroutine:i=". @ $i \ n "; So when we reference them here, we add two symbols in front of them, @ This is an array, and $ represents a two-time reference.Print "in subroutine:j=". @ $j \ n ";print ' in subroutine:the third the element is $ $j [2]\n '; #当引用数组中的一个元素的时候第一个 $ and later j[2] represent the third element in the array, and the second $ repre
byreference)Print "in main program after calling Subroutine: I =". "@ I \ n ";Print "in main program after calling Subroutine: J =". "@ J \ n ";# The following is a subroutineSub reference_sub{My ($ I, $ J) = @ _; # references are also a special form of data, which are stored as scalar variables in @ _.Print "in Subroutine: I = ". "@ $ I \ n"; so when we reference them here, we add two symbols before them. @ indicates that this is an array, and $ ind
contents of the standard output stdout default device (Terminal screen) to a string, you need to be careful, because stdout is standard output after all, and many parts of the program may need to use it. Therefore, try to modify the target of the standard output within a small piece of range. For example, surround with curly braces and stdout (the bare-word file handle can only be decorated with local):print "1. This goes to the real standard output\n";my $string;{ local *STDOUT; open STD
C Standard Library Reference Guide series translations
Author: poechant
Blog: blog.csdn.net/poechant
Email: zhongchao.ustc@gmail.com
Date: February 26Th, 2012
Ref: The C standard library Guide
This series of translations is being updated continuously(1) assert. HC standard Library Reference
list (that isAP) Followed by another parameter.Type. Note:APMust beVa_startInitialization. If no parameter is set, the result is undefined.
10.4. va_end
Statement:
Void va_end (va_listAP);
Allows a macro with parameters to be called.Va_start. IfVa_endIf the function is not called before return, the result is undefined. Parameter ListAPAfterVa_endAfter and not calledVa_startIt cannot be used before.
Instance:
# Include
# Include
Void sum (char *, Int ,...);
Int main (void)
{
Sum ("the sum
ifSetjmpReturnValueThe value of the variable is the same. VariableValueThe value is not returned to 0. If 0 is passed, 1 is used instead. If the function that calls setjmp has been terminated, the return value is uncertain.
Instance:
# Include
# Include
Void some_function (jmp_buf );
Int main (void)
{
Int value;
Jmp_buf environment_buffer;
Value = setjmp (environment_buffer );
If (value! = 0)
{
Printf ("reached this point from a longjmp with value = % d. \ n", value );
Exit (0 );
}
Print
character. If a character Meets the appropriate conditions, it will be converted by this function. Otherwise, the function returns the original character.
Condition:
Tolower
If it is an upper-case letter, it is converted to a lower-case letter.
Toupper
If it is a lowercase letter, it is converted to the corresponding uppercase letter.
Instance:
# Include
# Include
# Include
Int main (void)
{
Int loop;
Char string [] = "this is a test ";
For (loop = 0; loop
cute pop-up window ToolPractical tutorials from spyrestudios
How to make all browsers correctly render HTML5 labels, or even IE6From nettuts + site
Make HTML5 and css3 no longer pityTools and technologies that make HTML5 and css3 more cross-browser compatible
Implement HTML5 dragA tutorial from nettuts +
My 5 HTML coding habitsPersonal coding preferences and guidance
HTML5 micro-data: Welcome to machine worldAn overview of microdata specifications
Combined with css3 and HTML5 TechnologiesA tut
);
/* Rest of code */
}
Int main (void)
{
Open_record (null );
}
(1) assert. HC standard Library Reference Guide series (2) ctype. HC standard Library Reference Guide series (3) errno. HC standard Library Reference Guide series
. If the signal call fails, returnSig_errAnd setErrnoSet a reasonable value.
9.3. Raise
Statement:
Int raise (intSIG);
GenerateSIGSignal.SIGParameters must matchSIGMacro compatibility.
If the call is successful, 0 is returned. Otherwise, a non-zero value is returned.
Instance:
# Include
# Include
Void catch_function (INT );
Int main (void)
{
If (signal (SIGINT, catch_function) = sig_err)
{
Printf ("an error occured while setting a signal handler. \ n ");
Exit (0 );
}
Printf ("Raising t
,Char_maxThe maximum value of the unsigned struct type (Uchar_max).
Mb_len_max 1
The maximum number of characters that can contain multiple bytes.
Shrt_min-32767
The minimum value of a short integer.
Shrt_max + 32767
The maximum value of a short integer.
Ushrt_max 65535
The maximum value of the unsigned short integer.
Int_minutes-32767
The minimum value of an integer.
Int_max + 32767
The maximum value of an integer.
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.