Perl--printlog函数

#use strict; 
#use warnings;
use File::Path;
use File::Copy;
use DBI;
#use Net::FTP;
use HTTP::Date qw(time2iso str2time time2iso time2isoz);
sub printlog
{
  print "@_ is @_
";
  my ($LogInfo)= @_;
  my $CurrTime = time2iso(time());                   # 当前时间
  if(!defined($LogInfo) ){$LogInfo="";}
  my $StrLog="【${CurrTime}】 	 ${LogInfo} 
";

  print $StrLog;
  #print LOGFILE $StrLog;
}
printlog "ABCDEFG
";
[oracle@jhoa 2]$ perl a7.pl 
@_ is ABCDEFG

【2014-12-11 11:24:22】 	 ABCDEFG
 
@_

所有传入 Perl 过程的参数都是以 @_ 身份传入

原文地址:https://www.cnblogs.com/hzcya1995/p/13351966.html