zoukankan      html  css  js  c++  java
  • perl 调用方法 子例程说明

    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 提供了特别的符号用于方法调用 ->操作符
    

  • 相关阅读:
    Linux(Unix)时钟同步ntpd服务配置方法(转载)
    Linux SSH Publickey登录!
    三个最短路算法
    三个最短路算法
    最大子列和问题
    哈密尔顿环
    最小生成树应用解(超时)蓝桥杯2015初赛]灾后重建
    最小生成树应用解(超时)蓝桥杯2015初赛]灾后重建
    c++11的记录
    最大子列和问题
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/6200020.html
Copyright © 2011-2022 走看看