yyyll 发表于 2015-12-27 13:04:11

perl special charecter

  $_
  This is a special array for the subroutine duration.U can access it by use $_[<index>]. So the first parmater will be $_.
  The @_ variable is private to the subroutine, @_ is always the parameter list for the current subroutine invocation
  $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 "$_";
}


  

perlref
  If you put a \ in front of a variable, you get a reference to that variable.
  perlobject
  perl's subroutine first argument is itself or class/package name.
页: [1]
查看完整版本: perl special charecter