手机版
热门标签
站点地图
我要投稿
广告合作
联系我们
搜 索
广告位招租
广告位招租
切换导航
首页
编程教程
编程导航
编程百科
编程问答
编程博文
编程实例
硬件设备
网络运营
软件教程
移动数码
办公软件
操作系统
人工智能
栏目导航
▸ 编程语言
▸ 前端开发
▸ 移动开发
▸ 开发工具
▸ 程序设计
▸ 行业应用
▸ CMS系统
▸ 服务器
▸ 数据库
公众号推荐
微信公众号搜
"智元新知"
关注
微信扫一扫可直接关注哦!
子栏目导航
PHP
Java
Java SE
Python
NumPy
C#
C&C++
Ruby
VB
asp.Net
Go
Perl
netty
gRPC
Django
Delphi
Jsp
.NET Core
Spring
Flask
Springboot
SpringMVC
Spring Cloud
Lua
fastadmin
Laravel
Mybatis
Asp
Groovy
ThinkPHP
Yii
swoole
编程之家
Perl
Perl: 3.5. Interpolating Arrays into Strings
3.5. Interpolating Arrays into Strings Like scalars, array values may be interpolated into a double-quoted string. Elements of an array are automatically separated by spaces[*] upon interpolation: [
作者:编程之家 时间:2020-08-13
Learning Perl: 3.7. Scalar and List Context
3.7. Scalar and List Context This is the most important section in this chapter. In fact, it's the most important section in the entire book. It wouldn't be an exaggeration to say that your entire c
作者:编程之家 时间:2020-08-13
Learning Perl: 3.6. The foreach Control Structure
3.6. The foreach Control Structure It's handy to be able to process an entire array or list, so Perl provides a control structure to do that. The foreach loop steps through a list of values, executi
作者:编程之家 时间:2020-08-13
Learning Perl: 4.1. Defining a Subroutine
4.1. Defining a Subroutine To define your own subroutine, use the keyword sub, the name of the subroutine (without the ampersand), and the indented block of code (in curly braces)[] that makes up th
作者:编程之家 时间:2020-08-13
Learning Perl: 3.8. in List Context
3.8. <STDIN> in List Context One previously seen operator that returns a different value in an array context is the line-input operator, <STDIN>. As described earlier, <STDIN> returns the next line
作者:编程之家 时间:2020-08-13
Learning Perl: 4.2. Invoking a Subroutine
4.2. Invoking a Subroutine Invoke a subroutine from within any expression by using the subroutine name (with the ampersand):[§] [§] And frequently a pair of parentheses, even if empty. As written, t
作者:编程之家 时间:2020-08-13
Learning Perl: 4.4. Arguments
4.4. Arguments That subroutine called larger_of_fred_or_barney would be much more useful if it didn't force you to use the global variables $fred and $barney. If you wanted to get the larger value f
作者:编程之家 时间:2020-08-13
Learning Perl: 4.3. Return Values
4.3. Return Values The subroutine is always invoked as part of an expression even if the result of the expression isn't being used. When we invoked &marine earlier, we were calculating the value of
作者:编程之家 时间:2020-08-13
Learning Perl: 4.5. Private Variables in Subroutines
4.5. Private Variables in Subroutines But if Perl can give us a new @_ for every invocation, can't it give us variables for our own use as well? Of course it can. By default, all variables in Perl a
作者:编程之家 时间:2020-08-13
Learning Perl: 4.6. Variable-Length Parameter Lists
4.6. Variable-Length Parameter Lists In real-world Perl code, subroutines are often given parameter lists of arbitrary length. That's because of Perl's "no unnecessary limits" philosophy. Of course,
作者:编程之家 时间:2020-08-13
Learning Perl: 4.7. Notes on Lexical (my) Variables
4.7. Notes on Lexical (my) Variables Those lexical variables can be used in any block, not merely in a subroutine's block. For example, they can be used in the block of an if, while, or foreach:
作者:编程之家 时间:2020-08-13
Learning Perl: 4.8. The use strict Pragma
4.8. The use strict Pragma Perl tends to be a permissive language.[] But maybe you want Perl to impose a little discipline; that can be arranged with the use strict pragma. [] Bet you hadn't noticed
作者:编程之家 时间:2020-08-13
Learning Perl: 4.9. The return Operator
4.9. The return Operator The return operator immediately returns a value from a subroutine: my @names = qw/ fred barney betty dino wilma pebbles bamm-bamm /; my $result = &which_element_is(
作者:编程之家 时间:2020-08-13
Learning Perl: 4.10. Non-Scalar Return Values
4.10. Non-Scalar Return Values A scalar isn't the only kind of return value a subroutine may have. If you call your subroutine in a list context,[] it can return a list of values. [] You can detect
作者:编程之家 时间:2020-08-13
Learning Perl: 5.1. Input from Standard Input
5.1. Input from Standard Input Reading from the standard input stream is easy. We've been doing it with the <STDIN> operator.[*] Evaluating this operator in a scalar context gives you the next line
作者:编程之家 时间:2020-08-13
Learning Perl: 5.3. The Invocation Arguments
5.3. The Invocation Arguments Technically, the diamond operator isn't looking at the invocation argumentsit works from the @ARGV array. This array is a special array preset by the Perl interpreter a
作者:编程之家 时间:2020-08-13
Learning Perl: 5.2. Input from the Diamond Operator
5.2. Input from the Diamond Operator Another way to read input is with the diamond[*] operator: <>. This is useful for making programs that work like standard Unix[] utilities, with respect to the i
作者:编程之家 时间:2020-08-13
Learning Perl: 5.5. Formatted Output with printf
5.5. Formatted Output with printf You may wish to have a little more control with your output than print provides. In fact, you may be accustomed to the formatted output of C's printf function. Fear
作者:编程之家 时间:2020-08-13
Learning Perl: 5.4. Output to Standard Output
5.4. Output to Standard Output The print operator takes a list of values and sends each item (as a string, of course) to standard output in turn, one after another. It doesn't add any extra characte
作者:编程之家 时间:2020-08-13
Learning Perl: 5.7. Opening a Filehandle
5.7. Opening a Filehandle You've seen that Perl provides three filehandlesSTDIN, STDOUT, and STDERRwhich are automatically open to files or devices established by the program's parent process (probabl
作者:编程之家 时间:2020-08-13
Learning Perl: 5.6. Filehandles
5.6. Filehandles A filehandle is the name in a Perl program for an I/O connection between your Perl process and the outside world. That is, it's the name of a connection and not necessarily the name
作者:编程之家 时间:2020-08-13
Learning Perl: 5.8. Fatal Errors with die
5.8. Fatal Errors with die Let's step aside for a moment. We need some stuff that isn't directly related to (or limited to) I/O but is more about getting out of a program earlier than normal. When a
作者:编程之家 时间:2020-08-13
Learning Perl: 5.9. Using Filehandles
5.9. Using Filehandles Once a filehandle is open for reading, you can read lines from it the same way you can read from standard input with STDIN. So, for example, to read lines from the Unix passwo
作者:编程之家 时间:2020-08-13
Perl Learning: 5.10. Reopening a Standard Filehandle
5.10. Reopening a Standard Filehandle We mentioned earlier that if you were to reopen a filehandle (that is, if you were to open a filehandle FRED when you've got an open filehandle named FRED), the
作者:编程之家 时间:2020-08-13
Learning Perl: 6.1. What Is a Hash?
6.1. What Is a Hash? A hash is a data structure like an array, in that it can hold any number of values and retrieve these values at will. However, instead of indexing the values by number, as we di
作者:编程之家 时间:2020-08-13
Learning Perl:
6.2. Hash Element Access To access an element of a hash, use syntax that looks like this: $hash{$some_key} This is similar to what we used for array access, but here we use curly braces instead
作者:编程之家 时间:2020-08-13
Learning Perl: 6.4. Typical Use of a Hash
6.4. Typical Use of a Hash At this point, a concrete example might help. The Bedrock library uses a Perl program in which a hash tracks how many books each person has checked out: $books{"fred"}
作者:编程之家 时间:2020-08-13
Learning Perl: 6.3. Hash Functions
6.3. Hash Functions Some useful functions can work on an entire hash simultaneously. 6.3.1. The keys and values Functions The keys function yields a list of all the keys in a hash, and the values fu
作者:编程之家 时间:2020-08-13
Learning Perl: 7.1. What Are Regular Expressions?
7.1. What Are Regular Expressions? A regular expression, often called a pattern in Perl, is a template that matches or doesn't match a given string.[] An infinite number of possible text strings exi
作者:编程之家 时间:2020-08-13
Perl Learning: 7.3. Character Classes
7.3. Character Classes A character class, a list of possible characters inside square brackets ([ ]), matches any single character from within the class. It matches one character, but that character
作者:编程之家 时间:2020-08-13
上一页
1
2
3
4
5
6
7
8
下一页
小编推荐
热门标签
更多
python
JavaScript
java
HTML
reactjs
C#
Android
CSS
Node.js
sql
r
python-3.x
MysqL
jQuery
c++
pandas
Flutter
angular
IOS
django
linux
swift
typescript
路由器
JSON
路由器设置
无线路由器
h3c
华三
华三路由器设置
华三路由器
电脑软件教程
arrays
docker
软件图文教程
C
vue.js
laravel
spring-boot
react-native