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, $!"."\n"; 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.

posted @ 2014-04-29 22:27  pengfeis  阅读(177)  评论(0编辑  收藏  举报