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 $_[0].

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, $!"." "; while(<FH>) { print "$_"; }

perlref

If you put  in front of a variable, you get a reference to that variable.

perlobject

perl's subroutine first argument is itself or class/package name.

原文地址:https://www.cnblogs.com/peng-fei/p/3698363.html