Perl does not provide any special syntax for class definitions

Perl 不提供任何特殊的语法对于类的定义

A package is simply a namespace containing variables and subroutines. The only difference is that in a class, the 

subroutines may expect a reference to an object or the name of a class as the first argument. This is purely a 

matter of convention, so a class may contain both methods and subroutines which don't operate on an object or 

class.

一个包是一个简单的名字空间包含变量和子程序。唯一的区别是在一个class里,

子程序可能被期望一个引用到一个对象或者 类的名字作为第一个参数

这是一个纯粹的惯例,因此一个class可能包含方法和子程序  不操作在对象或者类上。

l does not provide any special syntax for defining a method. A method is simply a regular subroutine, and is 

declared with sub. What makes a method special is that it expects to receive either an object or a class name as 

its first argument.
Perl does provide special syntax for method invocation, the -> operator. We will cover this in more detail later.
Most methods you write will expect to operate on objects: 我不提供任何特殊的符号用于一个方法, 一个方法是一个简单普通子程序, 并且是以sub定义。 让一个方法特别是他期望接收一个对象或者类名作为第一个参数 Perl 提供了特别的符号用于方法调用 ->操作符

perl 调用方法 子例程说明的更多相关文章

  1. [No000085]C#反射Demo,通过类名(String)创建类实例,通过方法名(String)调用方法

    using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Sy ...

  2. ThinkPHP跨控制器调用方法

    跨控制器调用方法 1. 先造对象,再调用里面的方法 $sc=new \Home\Controller\IndexController();  用绝对路径找echo $sc->ShuChu(); ...

  3. perl 调用shell脚本

    perl调用shell命令 perl调用shell shell调用perl Perl执行shell命令的几种方式及其区别

  4. C# 反射之调用方法谈

    反射的定义 反射提供了描述程序集.模块和类型的对象(Type 类型). 可以使用反射动态创建类型的实例,将类型绑定到现有对象,或从现有对象获取类型并调用其方法或访问其字段和属性. 如果代码中使用了特性 ...

  5. 利用反射调用方法时,处理ref,out参数需要注意的问题(转)

    转自:http://www.68idc.cn/help/buildlang/ask/20150318283817.html 项目中如下的泛型方法,因为要在运行时,动态指定类型参数,所以要利用反射来实现 ...

  6. Struts2 Action下面的Method调用方法

    1. 在struts.xml中加入<constant name="struts.enable.DynamicMethodInvocation" value="tru ...

  7. 完整的分页存储过程以及c#调用方法

    高效分页存储过程 USE [db] GO /****** 对象: StoredProcedure [dbo].[p_Page2005] 脚本日期: // :: ******/ SET ANSI_NUL ...

  8. MySql 存储过程及调用方法

    存储过程实例: DELIMITER $$drop procedure if exists ff $$CREATE /*[DEFINER = { user | CURRENT_USER }]*/ PRO ...

  9. jquery ajax success 函数 异步调用方法中不能给全局变量赋值的原因及解决办法

    jquery ajax success 函数 异步调用方法中不能给全局变量赋值的原因及解决办法   在调用一个jquery的ajax方法时我们有时会需要该方法返回一个值或者给某个全局变量赋值,可是我们 ...

随机推荐

  1. python概要

    python与r语言接口Rpy,统计 科学计算,数值拟合:numpy,scipy 可视化2d:matplotlib,Pylab 可视化3d:mayaviz 复杂网络:networkx 交互终端: bs ...

  2. 基于visual Studio2013解决C语言竞赛题之0202坐标转换

    题目

  3. 第一篇:GCD的使用

    一.主队列介绍 主队列是和主线程相关的队列,主队列是GCD自带的一种特殊的串行队列,放在主队列中的任务,都会放到主线程中执行. 提示:如果把任务放到主队列进行处理,那么不论处理函数是异步的还是同步的都 ...

  4. 关于方法的ref

    没有ref的方法时: using System; using System.Collections.Generic; using System.Linq; using System.Text; usi ...

  5. grub2的/etc/grub.d目录下的脚本文件

    00_header,05_debian_theme,10_linux,20_memtest86+,30_os- prober,40_custom这五个脚本对应grub.cfg上的各个部分,有的版本的g ...

  6. (Problem 14)Longest Collatz sequence

    The following iterative sequence is defined for the set of positive integers: n n/2 (n is even) n 3n ...

  7. pay包注释(一)

    lovep2c项目pay模块注释: views.py: def create_user_no(email):    return md5(email).hexdigest().upper() + &q ...

  8. X-UA-Compatible是什么

    X-UA-Compatible是神马? X-UA-Compatible是IE8的一个专有<meta>属性,它告诉IE8采用何种IE版本去渲染网页,在html的<head>标签中 ...

  9. 模拟红外协议C程序——接收模块

    目的:方便程序的调试,提供效率,减少工作累,可以不在线调试编程时显示实时数据,特别产品不带显示的或者MCU是OPT的,有很大的帮助. 过程:将要看的数据发送出来,另一个板(一个带有显示的就OK了,显示 ...

  10. 零成本建立的.NET小组开发平台

    前言 说道.NET开发平台,首先想到的就是Visual Studio,建立.NET小组开发平台自然首推TFS.但其花费却也是相当昂贵的(当然在本国可以无视这些成本),近期的开发中接触到一些开源软件并读 ...