perl special charecter

  • $_

  • $PROCESS_ID

  • $$

read a file line by line


#!/usr/bin/perl
use strict;
use warnings;

my $dir ="./tmp";

open (FH, "<$dir/txn-history.txt") or die "Couldn‘t open $dir/txn-history.txt, $!"."\n";
while(<FH>) {
print "$_";
}

perl special charecter,码迷,mamicode.com

时间: 2024-10-29 06:56:23

perl special charecter的相关文章

[Perl 6][Project Euler] Problem 9 - Special Pythagorean triplet

[Perl 6][Project Euler] Problem 9 - Special Pythagorean triplet Description A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2. There exists exactly one Pythagore

Method Calling in Perl

This is notes from reading the "object oriented perl programming". Elements of the @_ array are special in that they are not copies of the actual arguments of the function call. Rather they are aliases for those arguments. That means that if val

在vi中使用perltidy格式化perl代码

格式优美的perl代码不但让人赏心悦目,并且能够方便阅读. perltidy的是sourceforge的一个小项目,在我们写完乱七八糟的代码后,他能像变魔术一样把代码整理得漂美丽亮,快来体验一下吧!!! perltidy 主页: http://perltidy.sourceforge.net/perltidy.html 安装方法: 进入解压后的文件夹,然后运行一下命令 perl Makefile.PL make make test make install 用法: 配置一下vim,使得我们在写代

[转载]两个半小时学会Perl

Learn Perl in about 2 hours 30 minutes By Sam Hughes Perl is a dynamic, dynamically-typed, high-level, scripting (interpreted) language most comparable with PHP and Python. Perl's syntax owes a lot to ancient shell scripting tools, and it is famed fo

perl学习笔记之:模式匹配,模块,文档

Perl语言的最大特点,也是Perl作为CGI首选语言的最大特点,是它的模式匹配操作符.Perl语言的强大的文本处理能力正是通过其内嵌的对模式匹配的支持体现的.模式通过创建正则表达式实现.Perl的正则表达式与模式匹配的特点一是内嵌于语言之中,而不是通过库或函数来实现,因此使用更简便:二是比一般的正则表达式与模式匹配功能强大. 模式匹配操作符简介 操作符 意义 实例 =~ 匹配(包含) !~ 不匹配(不包含) m// 匹配 $haystack =~ m/needle/ $haystack =~

perl学习之argument

Arguments are the values you pass to a Perl script. Each value on the command line after the name of the script will be assigned to the special variables$ARGV[0],$ARGV[1],$ARGV[2], and so on. The number of arguments passed to the script is stored in

Perl 内部结构详解

PerlGuts Illustrated Version 0.49, for perl 5.20 and older This document is meant to supplement the perlguts(1) manual page that comes with Perl. It contains commented illustrations of all major internal Perl data structures. Having this document han

perl核心模块解析(一)POSIX

perl核心模块解析(一)    POSIX 详细文档链接如下 源自:http://blog.csdn.net/jonathanxqs 转自:http://perldoc.perl.org/POSIX.html POSIX/?p?z?ks/, 是可移植操作系统接口(Portable Operating System Interface ),POSIX标准定义了操作系统应该为应用程序提供的接口标准,是IEEE为要在各种UNIX操作系统上运行的软件而定义的一系列API标准的总称,其正式称呼为IEEE

PCRE Perl Compatible Regular Expressions Learning

catalog 1. PCRE Introduction 2. pcre2api 3. pcre2jit 4. PCRE Programing 1. PCRE Introduction The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. PCRE has its own nat